Need help with enemy collisons
Armuel
Member Posts: 31
Ok so I have a chaser type enemy that chases you when you enter his line of sight. When you collide with any enemy, game.damaged becomes true and you flash red and lose half a heart. So, you can't take another heart of damage until game.damage becomes false, which happens 1 second after game.damage becomes true. But if you stay in contact with the enemy, you only take damage once, and you're just touching the enemy but game.damaged stays false. Any ideas? Help is appreciated
Best Answer
-
tatiang Posts: 11,949Just tested this and it works with a timer set to every 0 seconds with a rule inside that says when actor overlaps or collides with actor of type enemy --> change attribute self.health to self.health-1. I didn't use booleans, but I guess you could add that to slow down the rate of change of self.health.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
every .blah seconds do blah amount of damage?