Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Unintended infinite jump?
- F4LL0U7
-
4 posts
Unintended infinite jump?
I am working on my platformer game engine, and with my jumping / Y velocity script, it keeps allowing infinite jumps. I have tried many things to try and fix this, but none of them work.
THE CODE IS:
if up arrow key pressed
repeat until touching color (yellow) or touching color (black) or not up arrow key pressed
set Yv to 12
repeat until Yv = 0
change Yv by -1
repeat until touching color (black)
change Yv by -1
Does anyone know how to fix this? The project link is https://scratch.mit.edu/projects/115591312 if anyone needs to see it for further information.
Thanks.
- F4LL0U7
THE CODE IS:
if up arrow key pressed
repeat until touching color (yellow) or touching color (black) or not up arrow key pressed
set Yv to 12
repeat until Yv = 0
change Yv by -1
repeat until touching color (black)
change Yv by -1
Does anyone know how to fix this? The project link is https://scratch.mit.edu/projects/115591312 if anyone needs to see it for further information.
Thanks.
- F4LL0U7
- Greatguy123
-
500+ posts
Unintended infinite jump?
Your script is a bit weird. I don't think it's doing what you think it's doing. I would suggest looking through it more carefully. Maybe this script will do what you want:
- Methanatos
-
100+ posts
Unintended infinite jump?
The apple should only jump if it's touching yellow or black and if its y velocity is 0 (stopped) or negative (falling). If the apple is touching yellow or black but it is rising, then it has hit a ceiling and should stop rising/start falling.
- F4LL0U7
-
4 posts
Unintended infinite jump?
Your script is a bit weird. I don't think it's doing what you think it's doing. I would suggest looking through it more carefully. Maybe this script will do what you want:
It still didn't solve my issue, but it did make the jump quite smoother. I need a way to get it to not be able to double jump…
EDIT: It did actually, there was something added onto my script which made it a bit weird (the not pressed block). Thanks

Last edited by F4LL0U7 (July 6, 2016 05:05:46)
- Tenzinmishti_test
-
27 posts
Unintended infinite jump?
I have an infinite jump problem in https://scratch.mit.edu/projects/145863636/. Here is my code:
NOTE: The project that this code comes from SCROLLS.
- asivi
-
1000+ posts
Unintended infinite jump?
Please start creating your own topic and give details about what is the problem with. I have an infinite jump problem.
- Tenzinmishti_test
-
27 posts
Unintended infinite jump?
?Please start creating your own topic and give details about what is the problem with. I have an infinite jump problem.
- chegamer902
-
6 posts
Unintended infinite jump?
this script allows infinite jumps. does anyone know a fix because I need it to allow only one jump at a time?
Last edited by chegamer902 (Aug. 17, 2021 17:33:48)
- amazingscratchcoder
-
100+ posts
Unintended infinite jump?
Op was on 2016. Pls read guidelines before posting and don’t necropost
- chegamer902
-
6 posts
Unintended infinite jump?
what do you mean Op was on 2016. Pls read guidelines before posting and don’t necropost
- orangetheory
-
500+ posts
Unintended infinite jump?
what do you mean Op was on 2016. Pls read guidelines before posting and don’t necropost
this script allows infinite jumps. does anyone know a fix because I need it to allow only one jump at a time?
yeah same
https://scratch.mit.edu/projects/145863636/. Here is my code:Necroposting is when post on an old topic or posting something irrelevent to the OP (original post.) If you want to get help please make your own topic. Thank you. I have an infinite jump problem in
NOTE: The project that this code comes from SCROLLS.
- Paddle2See
-
1000+ posts
Unintended infinite jump?
What they are saying is that it is best to make a new topic in this area rather than reviving an old dead topic. It's easier to follow the discussion and doesn't send annoying notifications to the person that originally started the topic.what do you mean Op was on 2016. Pls read guidelines before posting and don’t necropost
- Discussion Forums
- » Help with Scripts
-
» Unintended infinite jump?