Getting a good Jump
Yanayaya
Member Posts: 1
in Tech Support
Hi everyone,
I'm new to game salad but have been working through the School of Interactive Designs training modules. What I wanted to know about was jumping, it's a question I've seen darted about in various places but those questions don't really cover what I need to know. My question is: I have a character that jumps when you touch the screen when you touch a button and you do so to avoid on coming obstacles. How do I make it so that if you keep your finger on the button the character doesn't just hover over everything? I tried applying a timer but it didn't seem to work.
Many thanks
A
Comments
Use when touch is released not when touch is down
Developer For BLUNTentertainment - Feel Free To Message Me! - Free Beginner Templates!
Sometimes you want to have the player jump when touch is pressed not released so here is another solution.
1) Make sure you have a force on the character keeping him on the ground. Either scene gravity or use an accelerate behaviour on him (I recommend the accelerate behaviour)
2) Create a local attribute in the character to tell the game if he can jump or not. It should be a boolean. Call it canJump. I use a rule that detects if the player is currently touching the ground. So if Actor collides with Ground.
3) When the Actor is in collision with the ground set canJump to true
4) Create a rule to check if canJump is true and drop the jumping mechanics into that. As part of the jumping mechanics block, once the jump has started, make sure you set canJump to false.
Now he won't be able to jump again until he is on the ground.
My Latest GS Game - Tiny Spirit
My First GS Game - Dashing Ralph
Excellent many thanks for all the info I'll get to it and let you know how things go. Cheers