I want a monster only collidable if it dies, not if just hit, how to do?

QuestionManQuestionMan Member Posts: 81
edited August 2012 in Working with GS (Mac)
Basically I have monsters moving towards the left side of the scene, and when I hit them now they die and can move around. But I want to make them tougher, so say I have to hit them twice before they die. I don't want them moving until the second hit, how would you do this?

Best Answer

  • robertkdalerobertkdale USAPosts: 912
    Accepted Answer
    Step 1

    Create a game attribute
    such as EnemyHitCount
    it can be an integer or index
    attribute.

    Step 2
    Create a rule within your enemy actors
    Type the following
    Attribute game.EnemyHitCount > 1
    Then add a Move behavior

    Step 3
    Create another rule just below the first rule.
    Type the following
    Actor receives event overlaps or collides with actor type (Name of missiles or object that you are shooting at enemies.)

    Lastly add a change attribute within this rule.
    Type the following within the change attribute

    Change Attribute: game.EnemyHitCount To: game.EnemyHitCount+1

    Every time you hit the enemy it will add one to the value of the EnemyHit Count attribute.
    Once this count is greater then two you enemy will move.


    Also check out this video by TShirtBooth. You may find it to be useful.



    I hope this helps.
    If you have an email address I can send you a screen capture of what I have described above. This will give you a visual representation.

    Robert K.

    Big Smile Games Play Happy!
    Check out our other GameSalad exclusives.

Answers

  • hotMagichotMagic Member, PRO Posts: 266
    Give them a variable called HitPoints or something like that. Then have a rule that says, when they overlap with whatever hits them (bullet, player, etc), make the hitpoints=hitpoints-1.

    When hitpoints =1 or whatever the low number is, make a rule to kill them on that variable.
  • QuestionManQuestionMan Member Posts: 81
    Thanks guys
Sign In or Register to comment.