Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how do i set a jump height limit??
- _THEBOSS_
-
57 posts
how do i set a jump height limit??
when up key pressed in my platformer, the ball just keeps rising until i release the key .. help?
- _THEBOSS_
-
57 posts
how do i set a jump height limit??
also… after awhile of sitting on the line, it drops suddenly through the line!! do i need to make the line thicker or create an overide variable?
- deck26
-
1000+ posts
how do i set a jump height limit??
Is the project shared? The solution will depend on how you're handling the movement.
- _THEBOSS_
-
57 posts
how do i set a jump height limit??
why do i have to share it? i linked it…
- _THEBOSS_
-
57 posts
how do i set a jump height limit??
i just used the scratch wiki steps instead of sprites as platform, i used color green 38/100/100
- deck26
-
1000+ posts
how do i set a jump height limit??
A link is no use if the project isn't shared!
- _THEBOSS_
-
57 posts
how do i set a jump height limit??
how do you share… i have been using scratch for a few years but only now got an account sorry im new.
- _THEBOSS_
-
57 posts
how do i set a jump height limit??
wait!!! it should be called 2020 pen platformer… make sure i did it right
- Turtl3Man
-
4 posts
how do i set a jump height limit??
A good way to this is to make a velocity variable. For the velocity variable, any time you want to jump, increase your y velocity, which will then be going up if it is positive, by a number (typically 1, but it can be any number, as long as it is positive. the larger the number, the faster it will increase velocity. 9.8 will be the most accurate.), by setting y velocity to y velocity + x (your number of choice). Then, have it so once you reach a certain y height that you stop increasing y velocity, and start decreasing y velocity, by doing y velocity either - x or + -x.
This should all look something like this:
This should all look something like this:
- deck26
-
1000+ posts
how do i set a jump height limit??
I recommend you search in Scratch for ‘platformer tutorial’ and look at the one by @griffpatch-tutor which will take you through things step by step.
If your sprite is falling too fast it will go through platforms. Imagine it moves 10 pixels at a time and the platform is 5 pixels wide - there is a good chance it will just fall through.
Don't know how you managed it by you seem to have two custom blocks called ‘check ground touch’ which is just confusing. Try renaming one of them.
If your sprite is falling too fast it will go through platforms. Imagine it moves 10 pixels at a time and the platform is 5 pixels wide - there is a good chance it will just fall through.
Don't know how you managed it by you seem to have two custom blocks called ‘check ground touch’ which is just confusing. Try renaming one of them.
- Wainggan
-
500+ posts
how do i set a jump height limit??
Problem: that will not work. A good way to this is to make a velocity variable. For the velocity variable, any time you want to jump, increase your y velocity, which will then be going up if it is positive, by a number (typically 1, but it can be any number, as long as it is positive. the larger the number, the faster it will increase velocity. 9.8 will be the most accurate.), by setting y velocity to y velocity + x (your number of choice). Then, have it so once you reach a certain y height that you stop increasing y velocity, and start decreasing y velocity, by doing y velocity either - x or + -x.
This should all look something like this:
This could work though:
Last edited by Wainggan (Nov. 22, 2019 17:43:02)
- qucchia
-
100+ posts
how do i set a jump height limit??
Inside the Ball sprite, replace this
-You're changing the speed y variable by -1 in two forever loops, remove one to make it smoother.
-You should set the speed y variable to 0 when the ball touches the ground.
If you have any further questions or doubts, feel free to explain by responding below. I'm following this discussion so I'll get notified if anyone does. You can also create a new discussion if you think you should.
with this
Some other things to do:
-You're changing the speed y variable by -1 in two forever loops, remove one to make it smoother.
-You should set the speed y variable to 0 when the ball touches the ground.
If you have any further questions or doubts, feel free to explain by responding below. I'm following this discussion so I'll get notified if anyone does. You can also create a new discussion if you think you should.
- _THEBOSS_
-
57 posts
how do i set a jump height limit??
hey, some extra info… i´m not making my own physics, just copying ´advanced platformer physics´ in scratch wiki
thanks for the help, ill try the ideas ill respond again when i have thanks again!
thanks for the help, ill try the ideas ill respond again when i have thanks again!
- _THEBOSS_
-
57 posts
how do i set a jump height limit??
ive tried all and none have worked!??? this is annoying… coped the griffpatch tutorial and still doesnt work!??
- deck26
-
1000+ posts
how do i set a jump height limit??
It's much easier to help if you share a project that isn't working as you expect so we can see where you're going wrong. Is this your only shared project and is the non-working code in place? Removing code that doesn't work makes it harder for us to help.
- qucchia
-
100+ posts
how do i set a jump height limit??
It is shared: https://scratch.mit.edu/projects/347291084/editor
- qucchia
-
100+ posts
how do i set a jump height limit??
I used that in your project and it worked for me. Are you sure you copied it right? ive tried all and none have worked!??? this is annoying… coped the griffpatch tutorial and still doesnt work!??
- _THEBOSS_
-
57 posts
how do i set a jump height limit??
i tried each and every one of the solutions… well i didn't put them in THIS script but in another… this is just the ‘advanced platformer physics’ in scratch wiki… i put each in… maybe i put them in the wrong spot but i doubt it
- Discussion Forums
- » Help with Scripts
-
» how do i set a jump height limit??