Invincibility (HELP!!)

ranthonydevranthonydev Member Posts: 19
edited November -1 in Working with GS (Mac)
First off, I would like to say how much I have enjoyed using Gamesalad so far. The past few weeks most every problem I have encountered could be fixed by really just sitting down and tinkering. But right now, for my platformer, it just isn't the case. I am trying to create some invincibility function, and its just NOT WORKING! I have the following

boolean game attribute "Invincibility" ( have also tried to make it an actor attribute with similar problems)
integer game attribute "playerhealth"

rule
when player overlaps or collides with actor with tag "enemies" (have already verified that only proper actors have this tag)
AND
game attribute "invincible" is false
change attribute "playerhealth" to "playerhealth-1"
timer
for 2 seconds (have tried both run to completion and not run to completion)
change attribute "invincible" to true
otherwise
change attribute to false

Know, this simple formula alone just doesnt seem to work right. The basic problem I have is it seems to change the attribute once, making character invincible for 2 seconds after being hit the first time, but never again. I wont get into the other stuff I had piled on top, becuase that was causing other issues. I have pulled the other rules out to solve this problem first. Can anyone tell me what I am doing wrong?

Note:
I am using the health bar (playerhealth) described by tshirt booth in his youtube vid

please let me know if you need anymore info.

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    well in your timer you have for 2 seconds, so your only telling it to change for 2 seconds one time, so actually the timers working right.
  • ranthonydevranthonydev Member Posts: 19
    hmm, I'll try it and see. Thanks!!
  • ranthonydevranthonydev Member Posts: 19
    you mean change it *for* for sends then *after* two seconds change the attribute back, right?
  • ranthonydevranthonydev Member Posts: 19
    bah
    you mean change it *for* four seconds then *after* two seconds change the attribute back, right?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yes try *for*, then after

    cheers
Sign In or Register to comment.