Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need help on a game.
- HenryCoolKid33
-
100+ posts
I need help on a game.
Hey! I am currently updating a tower defense game I am currently working on. The health system is different from other tower defense games for the enemy. The health is based on costumes. Like 5 costumes = 5 Health. But each time it gets hit, it emits a effect, which is an animation. So I needed help on towers damaging the enemy by huge damage. Like enemy got hit by a spear and it skipped 2 costumes and resume to costume #1. Thank you very much!
]
Also heres the link of my game, so you know where to look and how to implant it: Game
Also heres the link of my game, so you know where to look and how to implant it: Game
Last edited by HenryCoolKid33 (Sept. 8, 2022 00:36:29)
- legendary34678
-
1000+ posts
I need help on a game.
Hello! Assuming you have your costumes in order (costume 1 is right before costume 2 and so on) you can do this:
when damaged :: events //Whatever hat block you use to detect damage
if <touching [spear v]?> then
switch costume to ((costume #) - (2))
...
else
if <touching [ v]?> then
...
end
end
- HenryCoolKid33
-
100+ posts
I need help on a game.
Hey, I am kind of confused where to place it. Can you tell me where to place it? Thank you very much!
- legendary34678
-
1000+ posts
I need help on a game.
Your project is super big, so I didn't take a look at your code. But you could always check what damaged the bloon (with a super big if loop) and then change costumes the corresponding number of times.
- HenryCoolKid33
-
100+ posts
I need help on a game.
This code looks big, do you know where to place it?

- Discussion Forums
- » Help with Scripts
-
» I need help on a game.