Pages: 1
Topic closed
So I'm currently working on a tower defense game. It's very simple, and I already have most of it figured out and it runs pretty smoothly. However one of, if not the only, things I'm having trouble with is making the 'tower' lose health, or get damaged when an enemy hits it. Currently I have two variables, (one is "Enemies Destroyed", but that's irrelevant) and one is the Tower's Health. So what I have programmed for the enemy sprite is:
(btw in the actual script it's [color orange] TOUCHING [color gray])
[blocks]<when I receive[ start [/blocks]
[blocks]<show>[/blocks]
[blocks]<if><color[ orange ]is over[ gray [/blocks]
[blocks]<change{ tower health }by(-1 [/blocks]
[blocks]<end>[/blocks]
... and then it goes on with other things like movement, etc.
For what it's worth I have it programmed so that "When Flag Clicked", "Tower Health" is set to 30. Any help would be much appreciated. Thanks!
Offline
It has to repeat. If it doesn't, it will only follow that script once. Try putting another script that also starts with when I recieve [start] forever if touching color orange, change health by -1. Hope that helps. If you want, I can upload a test project!
Offline
Thanks!
Offline
Huh, in most TD games, the towers don't get damaged by enemies...
Offline
masterhand7 wrote:
Huh, in most TD games, the towers don't get damaged by enemies...
It was stated in this one that enemies could hit towers.
Offline
Topic closed
Pages: 1