Same actor (enemy) with personalised health? + bullet touch problem
i have a random spawner, that spawns an enemy every second that walks towards to the player. however, when 1 enemy dies, they ALL die. how do i make it so every instance of the enemy, has its own health? theres just 1 enemy, but multiple instances of it being spawned. they seem to be sharing the same health.
and im making for game for iphones, when you touch the screen, the player shoots in the direction of where you touched, however, if you touch the screen again before the bullet goes off-screen, it will change direction to the second touch.
how do i stop this from happening? so once its spawned and has its direction to travel, to ensure it stays on that route without additional touches altering that?
thanks in advance guys!
and im making for game for iphones, when you touch the screen, the player shoots in the direction of where you touched, however, if you touch the screen again before the bullet goes off-screen, it will change direction to the second touch.
how do i stop this from happening? so once its spawned and has its direction to travel, to ensure it stays on that route without additional touches altering that?
thanks in advance guys!
Comments
Hit the + button and it'll make a new attribute. Make it an integer one and call it 'Health'.
Now, in the main actor, you can reference this new attribute and set it to 3, for example. When the actor gets hit, change 'self.health to self.health-1'
Then if self.health = 0, destroy the actor.
Hope that helps,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
if anybody has any insight into my other problem (the bullet touch one), still looking for a fix on that