How to make actor jump when touching the screen
Mayhem_Madness
Member, PRO Posts: 168
Hello everyone, Thor speaking here. I am a bit stuck on this, i have seen a couple tutorials but most of them are with arrow keys not with touching the screen.
So i wanted to know how to make an actor jump up when touching the screen.
Also when it is in mid-air, how would i make it do another jump, but i only want it to be able to do 2 jumps in total, then it will fall back down..
Thanks.
Thor.
Comments
Let me make you a quick demo.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Here you go. Simple once you know how to do it. Hope it helps.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
There are a few ways you could detect a touch to the screen.
You could also place a large invisible 'button' graphic over the entire screen and use a 'when touch is pressed' rule applied to the button actor to trigger the jump routine.
Below is a link to a tutorial that covers setting up a double jump action, along with other movement options. The tutorial uses keyboard input, so you'd need to adapt it to whichever method you choose to trigger the actual jump.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thankyou Braydon, your a star.
But, do you know what i would need to change, so it jumps when it touches the screen not the actor itself?
Sorry for the inconvenience.
Thankyou.
Thor.
It does exactly that. When a touch is detected anywhere (mouse is down), it jumps. You do not need to tap the actor to make him jump.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Oh sorry, i don't why it wasn't working at first, now its working
Haha, so sorry about that.
Thankyou for that.
And thank you jamie, for that advice.
You're welcome, glad you got something working
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page