It’s not a big deal, but for a cleaner look to your game, you can make the ‘If touching (certain color or object)’ script into a custom block that runs without screen refresh. It makes it so that you don’t see the sprite rise up from the ground after hitting it.
If you don’t want it to sink into the ground, this is what you do: - make a custom block, name it whatever. - make it run without screen refresh - put the block in the code that breaks its fall - put this script for the custom block: define: blah repeat until Change y by (1) end change y by (-1) stop this script
How to actually make a jump: Make variable called "speed y" Make variable called "GRAVITY" When green flag clicked: Set "GRAVITY" to -1 Set "speed y" to "GRAVITY" Forever Change Y by "speed y" ------------------------------------- Forever If Touching color (color of your level backdrop or ground) Then: Set "speed y" to 0 Repeat until: NOT touching color (color of your level backdrop or ground) Change y by 1 ------------------------ Forever If "space" pressed? Then: Set "speed y" to 12 --------------------------------- Thx for reading me! You can also use events for the jump too!
You could also do a more technical and efficient way if you create your own block and make it run without screen refresh (name is gravity) then make a variable called gravity. Make your first like of code and do when start click> forever(custom block gravity inside forever ) then make a second list of blockes under your gravity custom block. Make this Gravity custom block>change gravity variable by -1>change y by gravity> add a if block and inside do> if touching sprite two change gravity to 0> and change y by 1. For jumping do if key pressed set gravity to 15. Hope this helps
If you have more than one colour or plan to add more than one colour use the touching sprie button under sensing. This will only work if your backdrop is a sprite
Just do when green flag clicked forever change gravity by -1 then put change y by gravity then just make it so its only doing that if not its touching the ground sprite or the color of the ground and then put if key space or key up arrow pressed set gravity to 12
I got ya! 1st step:use the method on this vid. 2nd step:add a variable called bounce power (or just bounce). 3rd step:when the sprite touches the ground, set bounce power to how tall you wanna be and then change it by -1 so the sprite won't just fly off. 4th step:when the sprite touches the ground change y by bounce power. if there is any mistakes tell me!
Or you could: Make a 'gravity' variable Make a ground sprite When green flag clicked Forever Change gravity by -1 Change Y by gravity If touching {ground sprite} Set gravity to 0 If key space pressed Set gravity to 12
No that won't work because you forgot to add When green flag clicked Set gravity to 0 Forever Etc... That's because if you don't add "set gravity to 0" at the start, your character will fly downwards really fast at the start if you keep clicking green flag
Griffpatch is probably raging at the fact that this is probably the simplest way of making gravity while it took like 30 minutes for griffpatch to make gravity
For everybody, use a touching ground instead of a touching color for smaller sprites.
Thanks,really helps out👍
gooood
why does your comment says 2 replies when there is only one reply?
Bcuz u replied
@@Andrei_Anton-C20i think bc someone delete the comment
It’s not a big deal, but for a cleaner look to your game, you can make the ‘If touching (certain color or object)’ script into a custom block that runs without screen refresh. It makes it so that you don’t see the sprite rise up from the ground after hitting it.
If you don’t want it to sink into the ground, this is what you do:
- make a custom block, name it whatever.
- make it run without screen refresh
- put the block in the code that breaks its fall
- put this script for the custom block:
define: blah
repeat until
Change y by (1)
end
change y by (-1)
stop this script
How do I make the sprite not jump infinitely
Only make it jump if it’s touching the ground
@@Jekasnaka
Thank u this helped so much
Wdym end?
@@BradM-h1d end of the block
How to actually make a jump:
Make variable called "speed y"
Make variable called "GRAVITY"
When green flag clicked:
Set "GRAVITY" to -1
Set "speed y" to "GRAVITY"
Forever
Change Y by "speed y"
-------------------------------------
Forever
If
Touching color (color of your level backdrop or ground)
Then: Set "speed y" to 0
Repeat until: NOT touching color (color of your level backdrop or ground)
Change y by 1
------------------------
Forever
If "space" pressed?
Then:
Set "speed y" to 12
---------------------------------
Thx for reading me!
You can also use events for the jump too!
Rocket jumps fixed later!❤
Thank you this realy helped
Thanks dude! It helped so much and it’s so simple
Awesome tysm bro 🙂🙂
this is amazing! I'm making a jumping simulator and really needed this!
You could also do a more technical and efficient way if you create your own block and make it run without screen refresh (name is gravity) then make a variable called gravity. Make your first like of code and do when start click> forever(custom block gravity inside forever ) then make a second list of blockes under your gravity custom block. Make this Gravity custom block>change gravity variable by -1>change y by gravity> add a if block and inside do> if touching sprite two change gravity to 0> and change y by 1. For jumping do if key pressed set gravity to 15. Hope this helps
Thank you soo much for this easy tutorial, I just needed this in my game!
Your maze game is amazing 🎉🎉
I have tried it in my school laptop.
It is nice 👍.
thank you ❤️
tyyyyy!
This helped a lot thx
Ey nice i learned it from this tut but now im way better thanks
Thank you for this tutorial
If you have more than one colour or plan to add more than one colour use the touching sprie button under sensing. This will only work if your backdrop is a sprite
Who made me good at coding:
Self-taught: 10%
My teacher: 30%
This yt: 55%
Like me!
What about that 5%
scratch isn’t coding lol try learn assembly, (i tried to but the most i could do was print hello world)
@@5DPixel try learning luau(i made a call of duty game with it
I LOVE CATTTY THE SCRATCHYYY
Thx imma use this for something I think will be good :)
thank you soo much ty
Wow THIS VIDEO CHANGE MY LIFE!!
it is working thankyou very much
your wellcome .
good job bud!
it was a bit glitching and i couldn't get rid of it
woah it actually worked thx
Brow the next griffpatch
Bro isn’t the next griffpatch
Bro learn how to take a joke 💀
@@LaRRoEditzlearn how to spell💀
learn to make them. @@LaRRoEditz
@@LEGENDARY_CHEDDARLearn how to not argue over a scratch joke 💀
Thanks now I know. I've been trying to do this.
Thx man ❤
Kon sa application se create kar rahe ho bhai
Thank you so much I’m new to scratch so this will be a lot
Same
what your profile? mines stevenberry
Thank you so much
I remember using it once best childhood ever
so useful
thanks for telling some codes now i know what to do
Thanks
Thank you
PvzJosh2:wow great job!
Cool
yyeeeeeeeeeahhhhhhh
thanks now i can make the jumping mechanic in scratch
Good
tysm
love it
Thanx I remember I saw this before (probably by griffpatch) and forgot about it
Totally gonna use this. Thank ya.
Thx
😍😍😍😍
Just do when green flag clicked forever change gravity by -1 then put change y by gravity then just make it so its only doing that if not its touching the ground sprite or the color of the ground and then put if key space or key up arrow pressed set gravity to 12
tysm I need this for my game
Please where can I get the scratch app please
Thank you so much i just forgot how to do jump script
Coding in scratch is op
Right
This is interesting 🎉
It work :O
how you learn this? ITS AMAZING
Thanks :)
thx
How does it work with right and left key
Watch full tutorial here: ua-cam.com/video/RO8OE8jcIks/v-deo.html
i dont need full i just neeed shorts because i wear shorts
thank to tutorial
I Will Try This but Its Perfect
You can do better but you need Y velocity to do it And you can move while jumping
Can you make a tutorial where the sprite bounces a bit after hitting the ground
I got ya!
1st step:use the method on this vid.
2nd step:add a variable called bounce power (or just bounce).
3rd step:when the sprite touches the ground, set bounce power to how tall you wanna be and then change it by -1 so the sprite won't just fly off.
4th step:when the sprite touches the ground change y by bounce power.
if there is any mistakes tell me!
tysm tysm tysm tysm tysm tysm tysm tysm tysm tysm
Just add gravity and make move like 5 up when space is pressed.
Or you could:
Make a 'gravity' variable
Make a ground sprite
When green flag clicked
Forever
Change gravity by -1
Change Y by gravity
If touching {ground sprite}
Set gravity to 0
If key space pressed
Set gravity to 12
No that won't work because you forgot to add
When green flag clicked
Set gravity to 0
Forever
Etc...
That's because if you don't add "set gravity to 0" at the start, your character will fly downwards really fast at the start if you keep clicking green flag
There’s an easier way but this is still useful
people who just started scratch: am i a joke to you?
there is no need to use variables instead do this:-
when flag clicked
forever
if touching color (any color)
change y by -0
else
change y by -20
Blud use if touching level, and yes you do need that lil kid
But how do i tap "space" in mobile?
now there is overlap the playr is going in th floor !
how may i do
Griffpatch is probably raging at the fact that this is probably the simplest way of making gravity while it took like 30 minutes for griffpatch to make gravity
Why does everyone use if touching colour?
I can finally make my dinosaur game
I watched a 30 minute tutorial that did not work, but this 45 second one worked, which is ironic.
Thanka
if you pick up the sprite the speed goes up and body slams the sprite
im scracth Marianguy
Wow I did not know this thanks
Sooo.... I need to scrap my hardwork?
Edit:wth just happend?
Uh, maybe?
You could just do it differently
@@imakemymark2467 uhh. You're late. But... Eeh. I left scratch and learn actual coding on mimo.
what if u hold IT
Guys pls Explain How it works
I can't understand just made it but I wanna know how it works
Thats only for a platformer games so this one i know tho i forgot but thanks! I appreciate so much of you! 🤭
i accidentally went beyond and made 3 custom blocks to make a full engine for this with smoother jumps...
bro, teach me how to do this command but with a button
I used touching (ground) but thanks:D
Yoinkity splikity
It pulls me back the beggining
you name on scracth
😅😊,,scratch
I keep forgetting to use this all I do is just the same thing as the first script and add more repeats
BRO DID I JUST WASTE MY TIME TRYING TO REMEMBER IT ON TV 😭😭😭😭😭😭😭😭
Griffpacht
Hocammm bo dakka siz bu oyunun di l seçimini türkce yaptiniz❤😂
Way more intense than left or right 😅
for me is not jumping is teleport up and than slowly down
Thanks every time I move jump don't work
Scratchকোডবেরকরো
For everybody, use a sprite
For you groud
So you don't have to make it the same colour
Dude, my sprite is getting stuck in the ground, bruh
Same
what is so funny is that i have made code like this myself at the age of 11
It didn’t work I did the same thing and it don’t do anything
Griffpatch: ...
It doesn’t work😢
Hi! Send me please your project and I'll help you to fix it. It should work :)