Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Im creating an rts game and so far its going pretty smooth, however im beginning to work on variables and I am curious to know how to create a system where you can use points and buy units (rts player ai) and if you dont have enough points it will not let you buy it. Thanks! |
||||
|
Var points=1000; Menuitem: buy soldier IF klicked AND points > soldier_price Make soldier Points=points-soldier_price ELSE Print you dont have money ENDIF For AI there is no menuitem so periodically let him call buy loop to buy stuff.. |
||||
|
Hi sven can u pls elaborate the buying system implementation for us |
||||
|
Sure -not much to talk about it..its kinda simple so this example will show how to make it happen. Download: https://drive.google.com/file/d/... Simple example where you can buy soldier and tank units. Klick on house (its barracks produces soldiers) klick on closet (its tankFactory produces tanks (cars in this example) ) You see menu is the 2doverlays..you can extend it..just add more unit types and add menuitems. If this example was not what you meant then be more specific and i try to give better example. |
||||
|
|
||||
|
Thanks sven, for your assistance and time |
||||
|
Thanks it works very well! |
|