Hello, and thanks for reading. I'mmaking a platform game and i've done everything properly so far, but the only thing wrong is that when i press space quickly or hold it, i just float to the top of the screen (i have gravity so i do go back down). How do i make it so i can only jump once ( e.g. i cant jump while not touching the floor). Thanks for your time!
Offline
Try this:
When green flag clicked
Forever
If key [whatever key used to jump] pressed and touching colour [colour of ground]
Jumping script
End if
End forever
The 'touching colour [colour of ground]' is the important bit, as it means that unless the boolean is true, it won't be able to jump.
I hope this helped!
Offline
Glad I could help
Offline
They're not actual blocks, it's just it's quite hard to say the scripts using text. You see the 'if' block in control? Well, it's kind of a 'c' shape. The bottom bit of the if is what I'm referring to, and the same for forever.
Offline
Could you possibly upload the projects you have so we can see why it isn't working then? There's probably another script somewhere counterracting it
Offline
This works, and it also creates a smooth jump. Be sure to copy it EXACTLY, though. And change the color black to whatever color the ground is. If it jumps too high make the number 15 lower, and if it jumps too low, make the number 15 higher.
Offline