Need help with enemy collisons

ArmuelArmuel Member Posts: 31
edited July 2012 in Working with GS (Mac)
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

  • tatiangtatiang Posts: 11,949
    edited July 2012 Accepted Answer
    Just 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

  • ArmuelArmuel Member Posts: 31
    I'm trying to make it so the player will constantly receive damage when still in contact with an enemy , but only when game.damaged is false, and I can't figure out how to do this because the damage only registers once.
  • rhinokeyrhinokey Member Posts: 158
    can you use a timer in a rule if blah blah collides with blah blah
    every .blah seconds do blah amount of damage?
  • ArmuelArmuel Member Posts: 31
    Tatiang, the 0 seconds works! Thanks!
Sign In or Register to comment.