How can I get an actor to jump higher if touch is pressed for longer??

EireStudiosEireStudios Member Posts: 451
edited November -1 in Working with GS (Mac)
Hi Guys, This is my first newb question so please be gently. I have my actor set up with gravity using the accelerate down behavior and I have jumping set up perfect but now I want to make it so when the jump is pressed for that little bit longer my actor will jump that extra bit.

I'm guessing that this has something to do with timers but I just want to know the best most efficient way of doing it?

Comments

  • MelodyCatsMelodyCats Member, PRO Posts: 128
    In the game inspector create 2 boolean attributes.
    For example lets say action1 and action2

    in the jump button create some rules:

    rule 1

    when touch is pressed
    "change attribute" game.action1 to true

    rule 2

    when touch is pressed
    "Timer" after 2 seconds
    "change attribute" game.action1 to false

    rule 3

    when touch is pressed
    "Timer" after 2 seconds
    "change attribute" game.action2 to true"

    rule 4

    when touch is pressed
    "Timer" after 3 seconds
    "change attribute" game.action2 to false

    (you could combine some of these rules - but just to make it a bit clearer...

    Inside the actor that's jumping:

    rule

    when game.action1 is true
    change (lets say) velocity to (whatever)

    rule when game.action2 is true
    change velocity to (something else)
  • EireStudiosEireStudios Member Posts: 451
    Thanks very much MusicBoutique this worked perfect.
  • MelodyCatsMelodyCats Member, PRO Posts: 128
    Thanks - Glad it could help!
Sign In or Register to comment.