Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Hold Up To Jump Higher
- Pikmanfan2002
-
21 posts
Hold Up To Jump Higher
I'm working on a game where if you hold Up down for longer you jump higher, and tapping it will make it not jump as high. Any thoughts?
Jump Script:
Jump Script:
- Pikmanfan2002
-
21 posts
Hold Up To Jump Higher
Now I can't jump… and I tried changing it to -1 and nothing works :\ Hve you tried with ?
- Pikmanfan2002
-
21 posts
Hold Up To Jump Higher
nvm let me try adding it with and…
still does nothing new
still does nothing new

- fezzinate
-
100+ posts
Hold Up To Jump Higher
I made an example project that demonstrates jumping higher when you hold down the jump key. It has a bunch of comments inside to explain everything. The basic idea, and my favorite way of solving the problem, is to cut the velocity of the player in half once you let go of the jump key. This makes sure that whether you do a quick jump or a long jump, you get a nice arch.
https://scratch.mit.edu/projects/107620043/
hope that helps!
-Dan
https://scratch.mit.edu/projects/107620043/
hope that helps!
-Dan
- Pikmanfan2002
-
21 posts
Hold Up To Jump Higher
I put this in my game but there's just one problem. It makes it so that when you jump, you fall inside the platform itself, and to fix this I made: I made an example project that demonstrates jumping higher when you hold down the jump key. It has a bunch of comments inside to explain everything. The basic idea, and my favorite way of solving the problem, is to cut the velocity of the player in half once you let go of the jump key. This makes sure that whether you do a quick jump or a long jump, you get a nice arch.
https://scratch.mit.edu/projects/107620043/
hope that helps!
-Dan
Which allows me to not fall through the world, but when I insert your code, my code counters it and creates, in the end,
Any more thoughts?
- Pikmanfan2002
-
21 posts
Hold Up To Jump Higher
https://scratch.mit.edu/projects/107851343Now when I press the up arrow, I jump and then the YVel is stuck at -18 and never goes back to 0. Do yo like this?
Note that I did put the “set YVel to 0” in there.
- fezzinate
-
100+ posts
Hold Up To Jump Higher
I put this in my game but there's just one problem. It makes it so that when you jump, you fall inside the platform itself, and to fix this I made:Which allows me to not fall through the world, but when I insert your code, my code counters it and creates, in the end,Any more thoughts?
The code for touching the ground is in my example. You just have to make sure it's checking for the right color. But It seems to me you didn't take the time to study the code to see how it works. Just copying the code won't help you much. Really try to read through the code and the comments I left in there to understand what's going on so you know how to do it yourself
-Dan
- Pikmanfan2002
-
21 posts
Hold Up To Jump Higher
https://scratch.mit.edu/projects/107394482/Can you share your project in order to see how the ground detection is done? Now when I press the up arrow, I jump and then the YVel is stuck at -18 and never goes back to 0.
Note that I did put the “set YVel to 0” in there.
- Pikmanfan2002
-
21 posts
Hold Up To Jump Higher
What? Can't I just make what I want to make? To me, I love the battle mechanic. But I wouldn't say it's “super amazing and if you don't like it you should be ashamed.” I just like the game. But back to the topic, any ideas on how I can jump using I've seen your project.
- Pikmanfan2002
-
21 posts
Hold Up To Jump Higher
Yo digo que me gusta el juego, pero no estoy totalmente parte de la base de fans y quisiera ayuda en lo que puse en el foro de ayuda con guiones… solo digo . ¿Como dice usted, caballero?
- asivi
-
1000+ posts
Hold Up To Jump Higher
Bien, no es que me haya gustado el juego (cuando lo acabes estaré encantado de poder probarlo), pero lo que ví me pareció una tomadura de pelo, ahora mismo no puedo darte detalles al respecto pero esa fué la impresión que me dió. Si no es así me disculpo y te deseo buena suerte.
- Pikmanfan2002
-
21 posts
Hold Up To Jump Higher
I found out the problem. In my “goupground” block, I had it
I had a forever block in there. That was the problem. Thanks for all the help getting me for this conclusion!
I had a forever block in there. That was the problem. Thanks for all the help getting me for this conclusion!
Last edited by Pikmanfan2002 (May 3, 2016 14:00:42)
- Discussion Forums
- » Help with Scripts
-
» Hold Up To Jump Higher