Power Bar stopping gameplay?

OtherGuyStudiosOtherGuyStudios Member Posts: 26
edited November -1 in Working with GS (Mac)
I have a power bar that runs out when clicking spacebar to many times. How do i make it so that once it reaches the interval 0 it will disable the spacebar from working and thus making the actor fall to the ground? Keep in mind i am very new to gamesalad :)

Comments

  • ApplaudAppsApplaudApps Member Posts: 308
    You have a rule to detect space bar being hit and the behaviours it carries out. Add another rule saying that the power has to be above zero as well. Then spacebar will only work when power bar has some juice!
  • OtherGuyStudiosOtherGuyStudios Member Posts: 26
    No i have the power bar working. Power goes down each time i press spacebar. Now i have everything in place. When the interval reaches 0 then my character drops. But how do i disable the spacebar when that happens? Because straight after he drops i can press spacebar and he flies up again.
  • ApplaudAppsApplaudApps Member Posts: 308
    That's what I was explaining.

    At the moment you must have something like this :

    Rule : Key Space is down ... then .... do this (e.g. make guy fly)

    You need to add this :

    Rule : Key Space is down AND game.power > 0 ... then .... do this (e.g. make guy fly)

    So it checks whatever game attribute you're using to for the power level and if its zero it will break the rule. I assume you wait a few seconds and power climbs back up? At which point he can fly again.
  • OtherGuyStudiosOtherGuyStudios Member Posts: 26
    Nope. I also have a command that makes your power go up ever 2 seconds and there are things you collect while flying that also give you power. But when you run out you hit the ground and you are game over. I have a Rule at the moment "Disable Controls" Attribute game.energy = 0 then it changes velocity to a certain angle down. This is as far as i got. Now what?
  • ApplaudAppsApplaudApps Member Posts: 308
    Then the solution above will work. Add the extra rule ... game.energy>0 to your spacebar rule
  • OtherGuyStudiosOtherGuyStudios Member Posts: 26
    Thanks so much buddy! Perfect It worked.
Sign In or Register to comment.