How can I get an actor to jump higher if touch is pressed for longer??
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?
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
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)