how to set button to false after being pressed.. Tap Tap

app-etiteapp-etite Member Posts: 139
edited November -1 in Working with GS (Mac)
hi,

My character runs forward and pics up objects off the ground by pressing a button. when i press the button he collects the objects and when i let go of the button he does not, thats all good.

But what I don't want is the player to be able to just hold the button down to pick up all the objects in his path which is what is happening. I want the player to press the button to pick up an object and then to pick up the next object the player will have to let go of the button and press it again. much like the music tap tap games pressing the button at the right time.

Thanks

appetite games

Comments

  • ApplaudAppsApplaudApps Member Posts: 308
    Have an attribute called game.tap that = false (unchecked) at the start

    when button touched and game.tap = false then change game.tap to true and pick up object

    while the players finger is down game.tap will be true and so no more objects will be picked up

    when he releases touch then change game.tap to false

    now next time he touches the button the process will start again
  • ValanValan Member, BASIC Posts: 410
    Another way is to have two images to the same button; a pressed version and an unpressed version.

    The default is the unpressed image. Add another condition to your 'pick up' rule.

    When the unpressed version is on the button then the objects can be picked up and add Change Image to use the pressed version.

    Else Change Image to unpressed.
Sign In or Register to comment.