How to destroy an enemy after so many hits?
MacBruv
Member Posts: 6
Hi, After several attempts I cant work out what I am doing wrong? I am new to Gamesalad so would appreciate an example.
Here's what I've been doing with no luck
When bullet collides with actor, attribute game.hit to game.hit+1
And then
When game.hit=3, destroy actor
Appreciate an example cheers
Here's what I've been doing with no luck
When bullet collides with actor, attribute game.hit to game.hit+1
And then
When game.hit=3, destroy actor
Appreciate an example cheers
Comments
but you are thinking in the right way so I don't know why its not working...
make sure its a self.integer attribute. (we call it self.hit)
when actor overlaps or collides with bullet (not when bullet overlaps with actor)
change attribute
self.hit to self.hit+1
when self.hit = 3
do
destroy actor
hope this helped
-Timo-
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
As @timolapre1998 says use self attributes otherwise you won't be able to have more than one enemy on the screen.
All the best, cheers, M@
Or, you can add the display text behavior to your actor. Change the color to one that contrasts with your actor.