Scratch - Jumping and Gravity
Vložit
- čas přidán 1. 06. 2024
- A Scratch tutorial that explains how to add acceleration and gravity to a jumping object in scratch. The character will jump a bit like "Super Mario" or other 2D platformers. In this example I used a ball instead of a character so I added a bit of a bounce when it hits the ground.
Many people were asking for a Portal Tutorial... Here it is!
• How to make Portal usi...
This is my most popular Scratch Tutorial. Please tell me what else you'd like to learn about and I'll make more tutorials...
how to make A Game With A Inventory Please?
I'm doing a project for school and I'm trying to figure out how to make a sprite (with multiple costumes) perform a walking sequence. For example: If "right arrow" clicked "move x steps" and "set costume A". However, once the "right arrow" is clicked again, I would like for the sprite to move and switch to another costume (one that looks like a walking kind of action). So basically, every time the "right arrow" is clicked, it would move and also change costumes. Additionally, you would be controlling the walking with however many times that key is pressed. Sorry if I made it sound more confusing than it really is. From this video it seems like you know what you are doing so I thought I'd ask. Great tutorial!
***** Thanks So much!
MrMattperreault THANKS!
***** MY ACCOUNT: scratch.mit.edu/users/ACooIExit987656/
Some people just would rather not curse as much as others, just respect his decisions man. CZcams can only be a nice place if we all treat each other with respect.
6:50 You could just change velocity to -1.6 (Or something else of your preference) instead of having to put -1 and divide and include all that bounce count stuff. It doesn't make him bounce 3 times but he doesn't keep on bouncing.
I love it!!! I have been trying to understand this concept for so long but couldn't find a tutorial to explain it so simply and well!! ❤️
I'm in Year 9 and we are using this. This is great material and it would be helpful for future game designs.
This is the most helpful scratch platformer tutorial that I have seen. Good job!
This is great. Currently teaching robotics and we start out with programming on Scratch. While the kids work, I've been working to advance my own Scratch Skills. I'm wanting to make a sidescrolling game and this is the first aspect I'll be tackling. Thanks :)
4 years and scratch still hasn't changed
Well, it has, since that's 1.4, and I use to go on scratch before December, and it was in 2.0 when it was white and everything was different, so you probably are still playing on 1.4
but its still fucking shit
ItZ-GriPStockZ dont forget scratchX
Bam but have you seen griffpatch's projects? or even chooper100 thelogfather or scratchcube? let me know
umm scratch 1.0 is old
Brilliant video and slowly building the variables together to get the 'answer' is really great
Holy cow i have been searching for weeks and FINALLY I find this IT'S SO HELPFUL!!!! AND SIMPLE AS WELL!!!
3
3
I could never have figured this out without this video!
if you want a character to do an action he usually does to the right also to the left, you can do something like ¨when left arrow pressed, send to everyone the message LEFT¨, then, go to the character´s scripts an make a script that says something like¨when receiving LEFT, if key whatever is pressed, change sprite to whatever sprite¨. This new script will replace the action the key normally does whenever you press left.
I hope this is useful!
This is interesting. A 2011/2012 tutorial about scratch, that still works today.
If you want to have the character land be able to land on two different colours when you pick the colours go to options and move 'or' into the 'if' space. You can then select the colours
This was SUPER helpful! Thanks so much for making this tutorial! :)
Awesome Suggestion! Maybe I'll make another improved tutorial!
This vid really helped me make my ball quest demo, and I'm hoping to have the full game out in the next week, thnx a lot!
Nice answer! Very encouraging.... I started learning how to use scratch and understanding programing just few days ago. Its really great! Im vey interested in gravity use... Thanks a lot!
thx for the help i needed it for my sonic generations demo
Great job MrMattperreault :D!
Congratulations!!!
It's pretty nice to make your students understand all the things that are being said by you!
Congrats again :-)!
It's an excellent tutorial, lots of thanks; do hope you do more. Making small parts of games will be very helpful; I vote in favor for the portal gun.
Great tutorial. Thank you so much. It really comes in handy!
i agree with what MrMatt said to you but adding to what he said about the marks are very important for a computer class i have to agree with him. I have taken numerous "video game design" "computer programming" "IT" and other such computer classes and ive always found 2 things, 1 half of the stuff they teach you is just "school" and no one actually does that in the field and 2 with some subjects its alot eaiser to understand things if you find online tutorials and just play with stuff for weeks
Thank you! I have spent more than 2 hours to find this out!
Hello world! If you want to forget the bounce part this is what you need to do: Do everything he says until 5:05. Then create a separate script with this (Top to Bottom)
when green flag is pressed
forever if touching color [Whatever color your GROUND is {Not walls on the sides or ceiling}]
set velocity to 0
Then add your jumping things and your done.
Thanks a lot man. Your video was so useful, so automatically subscribed
you made this way more complicated then it could have been but still really good
amazing!!! i logically think of physics while watching this video, and i can understand it well. This video is a big help
You could check for the condition where y
Thanks so much! I'm making a scratch game about my little puppy, and I wanted to make sure she had a realistic, and working jumping animation.
this helped so much, before my guy look like a robot teleporting, now it actually has simple physics THANKS, too complex for me to figure out
YOU DESERVE A SUBSCRIBER KEEP UP THE GOOD WORK
Thank you for this amazing tutorial!
I am doing a scratch/java camp in 2 days. i was worried if i didnt know enough but after this video i fell like i know everything there is to know about scratch (of course i dont) but still thanks a lot!!!!
Thanks So much. I am a scratcher and this gets me stumped until now. :) thanks!!
ITS REALLY AMAZING!!I LOVE THE GRAVITY!!
This was extremely helpful for a school project (I did change some things though since I have a lot more to my game than this) but thank you so much!
This really helped me out, man, thanks a lot.
Thank you for this tutorial! It helped a lot!
Thank you so much! This tutorial was very helpful to me!
Thank you so much, this video helped with mostly all of my games in scratch! :D
Great tutorial, keep it up
Amazing tutorial, thank you very much. Helped A LOT.
for the horizontal movement, all you have to do to make it not move when you aren't pressing it is to put a "change x by Horizontal Velocity" inside of the if statement saying "if key left arrow pressed" and put if after the "set Horizontal Velocity to -3". do the same with the right arrow key.
if (key (left arrow) pressed?)
{
set Horizontal Velocity to -3;
change x by Horizontal Velocity;
}
if( key (right arrow) pressed?)
{
//repeat
}
//end forever loop
Like so people can see
Yes thank you. I have been looking for a video like this to help me with my project I have to do in class
Thank you! im playing in scratch 1.4 on my windows 10 and now i know how to make jumping and moving! thank you!
So good, helped me a lot
AWESOME
Thanks SOOO MUCH I NEEDED THIS SOOO MUCH
thank you, this is a massive help. this probaly saved me weeks in class
Nice job, and a good instructor! :D thanks! I learned a lot
I have used the gravity logic and maths to produce the same effect in CraftStudio (game making software) that uses visual scripting too - I hope to have a video out soon showing how I did it... Thanks
Really Helped me Out Thank you :)!!!!!
DUDE YOU MAKE THE BEST GAMES OMG :D I LOVE THEM DUDE.
You are the best!! This helped me do a incredible level and it is all thanks to you!! :D
this is fantastic!
Nice work!
thank you so much! that really helped me with games because before my character could only jump one way, Thanks
Thank you sooooo much!!! This is sooooo helpful!
Nice tut. Velocities were explained well, even though I figured this out the third month I joined. I really wished that scratch allowed for 3d objects, even though you can make 3d objects using math and the pen. That was one of the big reasons I moved onto unity and java.
This tutorial helped me alot thank you
Thank you for uploading this tutorial. When I was creating this on Scratch, it somewhat lags (it has to takes a second or so to calculate it before it preforms each single movement). How do you make it become more smoother like in your video?
I'm not sure what is wrong with your code but your best bet is to always rewatch the tutorial and double check you've done everything right. You might also want to try redoing it from scratch.. :)
Wow this is amazing!! thanks! :D
This helped so much thx!
Hi grmr3ap3r1. Don't worry too much if the theory is bogging you down. Passion is more important than marks. Computer Science is one of the only fields where you can be a "self made" success story. :)
That said success with computer programming comes with being persistent and learning how to be a good learner. So I'd suggest saving your progress, and starting again. You'll probably catch your error when you rewatch it.
thanks. I actually did by accident because I thought it was what you said, but it was worked and was less complicated so I went with it haha
You don't need to make the HorzVelocity variable, you can just go to motion and drag " Change X by___" In there you should put -10 for left, and 10 for right!
You do need it, since it is like Mario, it increases speed over time
rather than setting y to y + velocity you could have changed y by velocity, it would just have made the code simpler, very nice tutorial
My plan is to create a few tutorials on scratch. I'm not sure about making a whole game but I like the idea of making small parts of a game that people can borrow and use to make their own games better. I was thinking about making a portal gun in my next tutorial what do you think?
YOU ARE AN INCREDIBLE SCRATCHER!!! do u do ant other computer programing like vbs, c++, C#,Jva(not javascript) etc. ?
aww dont quit scratch this is wayyyy in your futer ive been doing scratch for 3 years and just now is this making sense to me :P
Thank you soooo much this helped a lot!
thanks for this matt!
Thanks,
You helped me so much!!!!
Youre awesome!!!
Thx this helped me a ton!
thank you so much I was having troubles with platformer games
Thank u this video helped me alot
are the best... Like your tutorials. Please make new one's!!..
This was best thing I learned in year 2 one university...after watching your video...a d this can translate well to unity that kinda has in built gravity based on collider...
Bit in unity you upsets for everything 3ven jumping because ray can allow all kinds of switching.
.
I used your tutorial @MrMattperreault but my guy gets stuck into the floor after a jump, and you need to jump again to get him to the surface. any advice?
Thank you so much this really helped and you are so smart
what do I do withe missing plug in message when I press the create button. I tried to click on the missing plug in button hoping it will lead somewhere where I can download the pug in, but when I press it nothing happens.
Wait lol nv thnx so much! keep uploading tutorials!
Amazing!
this vid helped a lot!!! thx
thanks
WORKED!
You are amazing bro thank you very much!!
Thank you so so much this is amazing and it really helped me. ;0
Awesome Congrats!
Thank you soooo much this is awesome!!!
This is super helpful thxs
thx, helped me a lot, took me like 5 years to do it though!
Its been over 5 years have you done it yet?
i just liked and subbed bro!
Helped a lot! I am using this for an undertale game
Thnx dude your amazing Liked and subbed :p
You need to make a sensing dot below the character and in the script put forever if the (colour of sensing dot) is touching ( colour of the platform ) bounce
you helped me a lot thanks
very helpful, and I would strongly suggest making more videos on scratch. If you feel up to it, make a video on how to create a whole game, not just the jumping part. Thanks still though the video was extremely helpful
I am currently using this Tutorial to create a visual script in CraftStudio - see my channel for examples - its a 3D game making software that you can make game with friends on - I am experimenting with it and hopefully going to use it with my after school games club. So thanks it is working.... and I will pop a video response when its finished...
thank you this helped me very much