I have a kind of tower defense game. However, I have the problem that I give my tower an upgrade feature which works great. As soon as I put down a second tower, it does not work anymore. Not even the interface can be seen when you press on the tower.
What can this be? I think I need something that just upgrades one of these towers. Maybe the system thinks that at the moment all towers will be upgraded and so on at the same time and that's why it does not work. I do not know how to improve individual objects (though they are the same) alone. ("Pick by unique ID ???) are there any good tutorials? Maybe it's something else.
Please help me :)
Just make sure you pick it properly with your conditions, otherwise I can'T help you without samples of your code im sorry !
Add instance variable to tower and menu objects, for example: which = 0. Then make sure that each tower in the game has a different number and each menu's variable matches that of the tower it is assigned to.
In your events you would check:
Mouse> On object tower clicked > instance variable which = 2 > If menu instance variable also = 2 open that menu
Then open menu for that tower
Develop games in your browser. Powerful, performant & highly capable.
How I make sure that each Tower in the game has a different number? Each tower is built during the game with enough resources.
thanks you for you help. After a lot of hours i found a solution and it work now. have a nice week!!!