Smooth Movement in Scratch - The EASY WAY
Vložit
- čas přidán 21. 09. 2023
- Although there are many tutorials on this subject, this tutorial will help you if they are a bit too challenging for you. Enjoy the video.
Click this link, or Gobo will destroy your family. / @bigfatsnakeviiper
More than 99% of crimes happen to people not subscribed to this channel. So, to protect yourself and your loved ones, consider subscribing.
Liked this video? Check this out next: Making a Game - The Way Scratch Team Intended: • Making a Game the Way ...
#scratch #coding #game #gamedev #easy #simple #viiperrr #smooth #smoothmovement #movement #scratchgames #scratchprogramming #programming #development #cat #scratchcat #fast #quick #arrowkeys #up #down #left #right #arrows #motioneffects #scratchprojects #codingtips #gamedevelopment #tutorial #codingforbeginners #moving #motioneffects #zonxscratch #quick #fast #scratchgames #theeasiestwaytomakeaplatformeronscratch #howtomakesmoothmovementinscratch #easiestway #theeasyway #easyway #smooth #smoooth #smooooth #new #howto #whyyourscratchgamesflopandtheeasysolutions
this was very helpful, not only did he show us the script, he also explained it in a very simple way
earned a sub!
Thank you!
yes
Nice job bro! You have a ton of potential, keep up the great work!
For the movement, you can also use
Change [x vel] by ( key (right arrow) pressed?) - (key (left arrow) pressed?) * (Chosen speed))
And the order must be the same on the keys or it will be reversed
For people who want to know why, it's because if the right arrow key or left arrow key is pressed, it counts as a 1, so you could do if the right arrow key pressed = 1, it would be the same as doing it as he did in the video. And by subtracting the 2, let's say you are pressing the left arrow key, that's 0 - 1, which is a negative one, and that is your movement. Same vice versa but it's positive. Multiplying this makes those negatives and positives bigger so you move faster. If you hold both down simultaneously, it's 1 - 1 which is 0, which is why you don't move. This is the common way to do it, and I like this method. Here is a nice table explaining the different movements:
right is the right arrow key, and left is the left arrow key
1 = pressed and 0 = released
1 - 0 = 1 (right movement)
0 - 1 = -1 (left movement)
1 - 1 = 0 (No movement)
0 - 0 = 0 (No movement)
And the it's the same with up and down.
And as he was saying, if you flipped these, the keys would also be flipped as if you press down the left arrow key (which expects you go to left) it would be 1 - 0 which is 1, and that is right, and not left.
TYSM man, this tutorial rlly helped 😁
Good job and thank you. I was searching for a vid but I didnt find but thanks god I found you. Thank you for explaining in a very good way. DESERVE A SUB
thanks so much bro i needed this for the junior innovate competition!
Glad I could help!
Thank you! This helped out alot!
Thank u sm for this, im adding this to my likes for future purposes. This tutorial is so concise and very easy to understand, i rlly believe this would blow up soon enough. Also, could u make a tutorial how to stop the sprites from moving when theres a play agaon button?
Yes, make sure you are subscribed so that you don't miss it when it comes out. :)
ofc, thank u!! @@bigfatsnakeviiper
You’ve inspired me on making a second channel about Scratch
thank you soo much! i used thease in alot of my games! you got a sub!!!
Glad I could help
Very helpful, you just earned a new sub :D
Thanks for the sub!
tysm bro I just started scratch and this helped me understand some of the mechanics
Glad to help!
congratulations this is the 250th subscriber
Thanks
you also can replace if ... pressed block to change [x vel] to d - a, and change [y vel] s - d
Yeah, I just decided to do it this way in this video to make it easier to explain.
@@bigfatsnakeviiper true = 1 and false = 1; so d - a. If d pressed, the first value will become 1 and now you have 1 - 0 = 1 .Release it and it will set back to 1. Same for A. If a pressed, the second value will become 1 so you have 0 - 1 = -1
Very good/helpful tutorial!
Glad it was helpful!
this a w tutorial, keep it up man.
Thx
i thought that this would be one of the vids with >100k views, because it’s helpful, and really good, but 3k views!?? keep going and you’ll go big, homie 😁
Glad it helped!
Although it doesnt have 100k, it now has 10k!
Thank you so much this helped me enourmously,
Glad it helped!
3.91 thousandth subscriber, you did a great job explaining this, I've been trying to figure out how the script works for a while, and you explained it in less than 3 minutes! (OMG he actually replied!)
Thanks!
and also made it look easy to learn thank you very much very very much
thank you very much because of your video I learned how to make smooth movement
I needed this bro thank you x500
Wow! That's a lot of times.
thanks it was helpful :)
Hey, vsauce Michael here. This tutorial is the best!
THANK YOU SO MUCH FOR HELPIING ME U EARNED A SUB!!!! :)
Nice Video it help me alot Thanks! =)
Glad it helped!
hey, I say =)
You can also make a separate sprite and make the cat follow smoothly using distance to mouse pointer var
You are a Hero
lol
I LOVE YOU I LOVE YOUUU! THANKYOU SO MUUCHH!!
Comment "Smoooooth"
Edit: Also, thank you all for 1000 views!
Edit Edit: thank you all for 10000 views!
*_smoth_*
smooth
@@bigfatsnakeelapiddd smooth
Smoooooth!
Smoooooooooooooooooooooooth
ty so much
You're welcome :)
thanks💯💯
No problem
this is so damn useful
Thanks
How do I do this with mouse instead of arrow keys or wasd? I need the sprite to follow my mouse, but also have the x and y vel variables so I can add collision.
I'm making a drawing minigame, and I want the pen sprite to stay in the canvas area (I added an invisible "hitbox" border to the canvas, so it should work like your collision tutorial intends)
When flag clicked
forever (point towards mouse pointer, move (adjustable) steps
THANKS
If you had a (somehow) big map or a small character, I can see that there is no limit to how fast it can go as when you hold down the arrow key it keeps changing it by 1 or -1 forever until you let go, so doesn't that mean you can go like really fast if you can move on screen for a while?
I see what you are thinking, but that isn't true. The player's speed will always slow down due to the set x vel to x vel *0.8 block. But, if you removed that block you would be correct.
You guys are very smart lol.
Why is there a rainbow line going around the likes at the end
It’s a new CZcams feature.
is it just me, or does Viiperrr deserve more attention on yt?
NO WAY THIS CHANNEL HAS LESS SUBS THAN ME! YOU'RE SO UNDERRRATED!
Thanks😀
EXACLTY BRUH
@@mangobrawl64thanks for the support
THE SLIDE IS WHAT I NEED! 1:32
Smoooooth
Im not good at this, could someone explain why and what i need to do to stop one of these scripts controlling another sprite? I tried to have two sprites with this movement (with different keys controlling) and it didnt work.
Nvm I figured it out, ty for the tutorial
Glad you figured it out
amazing
Thanks
Hey, my sprite just goes diagonally down-left and diagonally up-right and when I press left it goes down and when I press right it just speeds up and goes right
Make sure that you are changing the x vel variable for the left and right arrow keys and are changing the y vel variable for the up and down arrow keys. (If you need more help, I am happy to assist.)
this helped a ton! i was wandering how do i make my sprite look the way it is going?
You can use a set rotation style to left right block at the top of your scripts. Then, in the right arrow key pressed condition point your character in direction 90 and in the left arrow key pressed condition point your character in direction -90. (I will make a tutorial on this subject in the near future, so consider subscribing.) :>
i did sub and ty man@@bigfatsnakeviiper
why is your scratch colored green
because im green (jk, i use scratch addons)
@@bigfatsnakeviiperlol
yes
@@SeekersRobloxV2IsComingikr so much better
@@bigfatsnakeviiperwait...do you need scratch addons to colour a sprite differently?
my character immediately flys to the corner
Thanks so much for this tutorial it really helped my game look better(arcade simulator by bibideath on scratch(still working in progress rn)
Glad it helped!
Thank you!
*subscribes*
Thanks for the sub!
@@bigfatsnakeviiper You're welcome!
@@bigfatsnakeviiper I'm attempting a game, and this really helped!
where did u got the music???? I need that info please like.. PLEASE-
it's Daisy Circuit from Mario Kart wii
why does multiplying the velocity by a decimal cause it to stop and not slide? is it because we set our velocity to a higher number than we set it to stop by, so it keeps going, but slows down after we stop inputting?
Pretty much. Multiplying any number by a decimal makes that number smaller, so that means that if we multiply our speed by a decimal we go slower.
@@bigfatsnakeviiper made sense, i was just primarily confused by how it stopped us at the end of our movement. is there physics in scratch that cause our velocity to come to a stop? i thought the movement would keep going
i tried to mix this with your gravity tutorial but now the character cant do anything at all. Is there a way to fix this?
hey my sprite can only go up if im moving to the left? i cant get it figured out
EDIT: i can only go up or down on the left side
Can you please explain again? I didn't understand what you were saying.
Smoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooth
that's a lot of o's
Smoooooooooooooooth
respect
Hope to see more videos. You are really good at explaining.
@@njjc521 Thanks!
Smoooth
yes smooth
very useful! but how do I make it like its a animation?
this helped a lot, except when i hold the left arrow it goes slower than usual. how do i fix that?
nice video
but one issue i have:
when i use the right and left arrows, and yes i set them up correctly, they don't work. the sprite doesn't move left or right.
and when i added the up and down part, the left and right changed the y, but so did the up and down.
Could you send me the link to your code? I'll be happy to fix it.
@@bigfatsnakeviiper i'll try and find it but it might take a month because i dont even go on scratch too much and the time i am on scratch, i will loook for it
1:44 bro sounds like my math teacher 💀
underrated scratch programmer fr
Thanks
@@TheOffspringy hater
@@TheOffspringy I didnt say it was the most impressive thing ever I just said that his channel was underrated nothing agaisnt you its just I never said anything about it being impressive just that he was underrated
cool 😄😄@@TheOffspringy
How do I make it so when I’m not moving it switches sprite
the left and down movement won't work in my project, any ideas on how to fix this issue?
How do I do it with w a s d it just makes s and d super fast
My animation is bugged, when i press Up arrow or Down arrow my character goes only 8 Y
I wish i had the materials to make this kind of good content, i dont even have a pc 😭
Ooof
@@Minivirtualman yea ikr :(
me watching this as an advanced scratcher
Only issue is this is tied to fps, so adding delta time component would fix this.
What do you mean by that, exactly ?
@@el_calorie2867Say you have a forever loop that runs every frame, say the game is running at normal 30 fps then the game will be moving at the speed the developer wanted, but if they have a shitty computer and running at 20, then the game will be slower.
@el_calorie2867 Multiplying something by delta time is pretty much the way of making laggy people move the same speed as normal people, so if you are laggy, multiplying by delta time (which will be higher if laggy) will make you move farther each frame to keep up with the normal person.
It broke at the "Times x vel by 0.8" But I can still use the sliding feature for my game! I look upon you viper!
For any scratch assistance.
Did you use a set it up properly? (set x vel to x vel * 0.8)
@@bigfatsnakeviiper I did :/
Smooooooooooooooooooooooth
yes
Woah I got a rainbow outline on the like button when the vid ended
How u do dat
That means that while you were watching the video, someone liked the video.
I don't understand why x vel multiplied by 0.8 slows it down? I saw from grifft the same thing but i dont understand how it works exactly
Multiplying by 0.8 makes the player slow down b/c multiplying by a decimal makes any value smaller.
@@bigfatsnakeviiperso is it that x vel for eg. was 8, it would keep on decrease in value as long as the key isn't clicked to move the player causing them to slow down?
@@dagger103 Yeah, exactly, you got it. :)
this helped alot, i have one problem.. i checked everything and I did it the same as you but my character for some reason wont go left, pls help
Make sure that you are using a change x vel by -1 block in the key left arrow condition.
bro i dont know why but my charachter is moving so slowly and i followed your tutorial properly and did all the things correctly
but still i will give u sub as a nice tutorial ( you explained clearly )
i mean its not sliding
doesnt work for me if i press left arrow it teleports to the center of the field although i did all like u
Can you make a tutorial on wall collision using this movement script
Yeah, I am actually working on it right now. The video will be out in a week or two. :
@@bigfatsnakeviiper TYSM!! I am making a game and all I can find is platform stuff which is not the type I'm looking for, I've been looking for just wall collision in general
Make sure you're subscribed with notifications on so you don't miss it! ;)
The video is out!
@@bigfatsnakeviiper I'll watch it when I get home from school
i love you for this. MARRY ME!!!!
Lol
If you want it to be more smooda then make it more smooda it's so easy
Its Smooth Not Smooda
@@irjatipner7501 🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓🤓
@@irjatipner7501Smoode
how the heck do you make a new script
W toturial
thanks veryyyyyy mivh
my sprite is not moving the way you showed in your video any suggestions?
Could you add a link to your code?
@@bigfatsnakeviiper i just fixed it ty for trying to help and sorry for wasting your time!
1:47 um... actually any number * number less than one = less number, any number * any decimal larger than 1 is still more than that number. little mistake there.
yeah, i was only thinking of decimals under 1, thanks for pointing that out!
1:46 is where i’m up to
Is there a way to make it less laggy when stoping?
I’m not really sure what you mean by laggy. I’ve used this script a lot and most people don’t notice any lag. Could you be a bit more specific?
@@bigfatsnakeviiper it getts really choppy and slow after letting go of a key, it could possibly just be the device im using but im not sure
I think that it may just be your device, but I wouldn't mind checking your code to see if you made any mistakes. :)
idk what but i did something wrong
Up and down arrows act as backwards and forwards
Make sure you are changing y vel inside of x vel inside of the up and down arrow key conditions.
@@bigfatsnakeviiper OHHH NOW I GOT IT
thanks, you are actually really helpful
I'm impressed but only if you could add collisions
I have another tutorial for collisions
how to make the character look the way you are going?
i dont really know how to explian it
sorry
i did smth wrong IT KEEPS SLIDING EEN AFTER I DID THE NEW SCRIPT
oh wait i forgot
when i clicked left arrow it made me go down???
NVM fixed it
Bro , I tried it and it didn't even work. I keep sliding to down and I can't get back up. I already tried so many times and it just didn't work.
idk why but the x works perfectly but not the y. I copy and pasted the y and it doesn't work
and when I hit my up and down controls another piece of code runs meaning its picking up the input
I LOVE THIS HACK THANK YOU o((>ω< ))o I'M SUBBING YOU
Wait what if we want a joystick For mobile
Same
Yeah what if we want a joystick
for some reason my dumbass brain does something wrong when following these tutorials
Mine wasn’t moving and I checked but everything was correct
Wait I see what I might’ve done wrong
< (Mouse) < (0) and >
Is this really "smooth" or just fancy gliding?
It's smoooooth
Smooooooth
Depends. If you multiply by a lower number, the movement will be more slippery, but if you multiply by the right amount it can be smooth instead of stopping instantly. Most platformers use this mechanic
bro said "scrack"
Where lol
didnt let me move :/