Collisions in Scratch - The EASY WAY
HTML-код
- Опубликовано: 3 окт 2024
- 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 #scratchcat #fast #quick #arrowkeys #motioneffects #scratchprojects #codingtips #gamedevelopment #tutorial #codingforbeginners #moving #motioneffects #quick #fast #scratchgames #theeasiestwaytomakeaplatformeronscratch #howtomakesmoothmovementinscratch #easiestway #theeasyway #easyway #colisions #colide #colider #walls #ground #stopgoingintowalls #stopgoingintotheground #stopplayer #touchingwall
how to make a hitbox:
Make a costume with your hitbox (and ofc the player costume) use this code:
When green flag clicked
Forever
switch costume to hitbox
switch costume to player
This happens because the script at the end always goes last.
Thanks 👍
what happens if its a game were you jump mine is
X
Comment any tutorials that you would like to see from this channel.😀
An easier way to do this is to make a player collision box, and if the player is touching an object like a wall, make the player go to the box.
If you try to move up and down it doesn't work though, so for that we could use your code and save a little time.
gravity/jumping please
@@meowmeow6743 I've actually already done that in this video: Simple Jumping Physics in Under a Minute
ruclips.net/video/rk5iz8XFMpw/видео.html
Clicker game please
This Was the BEST tutorial I’ve seen on collision. I will be using this in the future!
Thank you!
I have a question does it work in games that have a geometry dash style? that are like from the side and have jumping instead of going up?@@bigfatsnakeviiper
@@ArtscoStudioShorts It depends on which jumping code you are using, but in a lot of cases it will work.
oh ok. Im asking because im using my own movement code and since ur making the collision physics by amplifying your own script i was just worried it might not work@@bigfatsnakeviiper
Thanks for the tutorial, I really needed it for an RPG game 😊
Oh ok
Glad I could help!
Simple and awesome tutorial, + sub, and a huge respect. I am not a beginner in Scratch but anyway this tutorial saved me from loosing tons of time. Very useful!
Thanks!
Thanks, although I am quite an experienced scratcher ( 3.4 years ) this helped a lot as I have forgotten to set the speed to 0 afterwards and therefore had the bounce effect continue in tight spaces. This really helped! Thank you. ( Btw I did discover the same smooth movement method as yours quite a bit before that video came out, however I have never gotten collisions to work.
ur channel is the best, it helps me out so much!!!! i remember the easy movement and i can do it by myself now! i honestly can not thank you more.
Happy to help!
yo you really helped me to make good movement for my game and collision. you are VERY underrated you are pretty good tbh
Thanks!
@@bigfatsnakeviiper np
making a pizza tower-esque game on scratch and you wouldnt believe how much your tutorials helped me
Love your vids! Keep up the good work :))
Thank you!
I love your videos dude, seriously these short and sweet tutorials are not only easy to understand but are also real time savers I was use to having to watch 25 minute videos breaking all of this down but you managed to do it in just 2. You deserve more subs. Easily one of the best scratch youtubers.
Glad you like them!
editing skills 11/10 keep it up :)
Thanks
@@bigfatsnakeviiper😄
💯
im not a scratch developer but i like watching this channel
Thanks.
Why did I think of this, “-1” times “x” will equal the opposite of the value inputted. My collision problems are over. Also Mythic Pixels for the win 😂
You got a new subscriber :D
Thanks1
Np:D
Thank you so much! My old collision system just made the wall like Glue. This has fixed that issue!😁
Glad I could help!
Bros whiskers are rock solid 2:07
lolol
Scratch cat needs some hitboxes!
Thank you so much. I've never understood collisions in Scratch. It turns out that by "touching" it means to overlap the sprite you want to touch.
Glad it helped!
Good topic. Good explanation 😊😊
Agreed. Great vid!
Thanks
@@bigfatsnakeviiper no problem! You explained this very well!
Also it can be 0 - x vel
Yeah
@@bigfatsnakeviiperViper? From Top Gun?
No lol
Wow!Great Job!🎉🎉😊.
Thank you! 😃
@@bigfatsnakeviiperYour Welcome!.
bros the reason good job exists
thanksssssssss for this video i am making among us😀😀😀😀😀😀😀😀😀
Hope you enjoy
What time do you upload
I don't have a particular upload schedule, but you can expect a video ever week or two.
W I love ur channel keep it up mate!
Thanks, will do!
You also can make like this:
put forever, if touching (Wall) then move ( negative player speed )if the wall if on right side or
( player speed ) if the wall its on left side
hope you understand
I did that and that didnt work i used offline editor
Can you please tell me what part didn’t work?
@@bigfatsnakeviiper i tried that and it was so bad that when i go to the center collision occurrs
I'm sorry to hear that. Do you perhaps have a Scratch account where you could post what you have so that I can fix what is wrong?
Thanks for the help before mine colison and movement were very laggy and now they are very smooth thanks!
Glad I could help!
Helps me with my TWHG Testing project.
My way to make collisions is making two variables, old x and old y, put them in the top of the forever loop and when the "Player" sprite is colliding with "Ground" set x to old x (put it after the "change x by "x vel"" variable). And the same for y
Nice!
great job! could you do a video about the easiest way to raycast?
Raycasting isn't easy, but I will look into it.
@@bigfatsnakeviiper thank you
i have a video idea if its possible to do : try make a game where u have to dodge the exploding barrel from the sky and the longer you survive you get points (rest is optional) you can make a store for the points with powerups
I will keep that in mind.
what do you mean "if its possible to do"? this is a game engine,of course you can make any game no matter how complex
I have a question. Is there a way to make this work for a simple AI, which just points towards the player and moves?
Online?
If you can't I don't mind making games without online
But if you can please tell me ❤
Also, I love your tutorials you getting a new subscriber!!!
I will consider making a video on that subject in the future. :)
@@bigfatsnakeviiper thank you ❤️
Can you make a video about how to easily make gravity In games?
I've actually already done that in this video: Simple Jumping Physics in Under a Minute
ruclips.net/video/rk5iz8XFMpw/видео.html
@@bigfatsnakeviiperI thanks I didn’t see that because it was a short lol
How do I make it go in the opposite direction when a sprite touches it
how did you get the theme color on green?, also cool video
Haha now i will make a...... PLATFORMER 👹👹👹👹
viperr > khan academy
My Scratch cat head stuck in the celling when trying to collide
same
Thanks man! Its really helpfull
Glad it helped!
Very extremly good tutorial but there's a problem, the player isn't actually touching the level. It is one pixel further.
Thanks man that helped a lot. Like and Sub
2:17 he go into da backrooms
hello, I have the exact same movement code as you exact same collision code as you but when I run the game and try to use wasd my ctrls are inverted and scratch is jumping in steps like change y by 2 each time I press w/s same for a/d
Nvm I was just being dumb :D
I'm making a game where the player isn't restricted to just changing the x and y directly when moving, the player can rotate freely and move forward/backwards/side to side relative to their direction. How would I change this code to accommodate this?
uhh with me it just keep bouncing off and when its on Y axis it simply freeze, i think its a problem with my other piece of the code
this help TYSM!
i used all three of your tutorials but when I go on top of an platform in stops the cat from moving how do I fix that?
for some reason your cat stays still but mine like bounces off the wall??
pls help
wen i walk in a wall (with ate code) it sends it back by 6. (i some how made a bouncy wall while trying to fix it)
annd what happens if i dont use a smooth movement and instead use the
(move ( ) block)?
yo when I try to make like blocks that my character can collide with (ground in your case) the hitbox of the whole sprite becomes a cube and my character is always in it, how do I fix this?
cant see x vel
Coming soon.. Collisions in Scratch - The HARD WAY
i cant find the touching ground? block
great!
How do i make it so my guy won't slow down before hitting the wall
what happens if its a game were you jump??? mine is
For some reason my player can still go through the ground but just slower
Make sure that your set x vel to x vel *0.8 blocks are above your change x by x vel blocks. (Do the same thing for y)
@@bigfatsnakeviiper It is, i dont know wh its doing this
Just subed
Thanks.
Does this works for scrolling game?
I just put it in my back pack so I don't have to do the script again =]
Good idea.
thanks
No problem
How do we make Controls
for mobile
Collision chain
Collision
Collision
it dosent work bc my sprite follows the mouse pointer
Make a more advanced one because I FOUND A WAY TO CLIP THROUGH WALLS IN MY FIRST 1 MINUTE OF TESTING.
How to make it so when a sprite touches a sprite you die
For some reason when my sprite goes up to walls, the collision doesn’t work. But works when it hits walls going left or right, idk how to fix that 😅
Make sure that you didn’t use a change x by block in both if conditions. If that’s not it, make sure you didn’t use the x vel block in both if conditions. I hope this helped. 😁
@@bigfatsnakeviiper I accidentally put “change x by y vel x -1” 😭
It doesn’t work
With gravity
"easy way"
yes very ez
Hey uhm just wondering if you can help on wall collisions, ive watched alot of tutorials and unfortunately none of them seem to be working? im currently making a game for our school project and a little assist could help, if you're interested i can send you the link of our game to see for yourself. THANK YOU! :)
Thank you very very much
I cant find the ground in if touching
You need to male a new ground sprite for that.
Where do i find the x vel block
You make it
Cool video but are you already did this in the platformer video
Yes I have, but this is for my smooth movement scripts which is better.
I found a glitch in your code i can phase through my wall
W
x vel in german???
x Geschwindigkeit (x gesch) im guessing
It was acting a little weird and I don't know why
i cant find the touching ground
Go to sensing and find the 'touching (selection)' block and select whatever your ground is on the selection.
@@certifiedbfdifan thanks but i already finished my project
What is x vel?
Follow my smooth movement tutorial first
I use a simpler way then that
What would that be?
IM EARLY!
You are lol
@@bigfatsnakeviiper how did you make your channel grow so fast?
@@diegotalksmonke It didn't grow that fast lol. I just devoted a lot of my time into this channel.
why is it not working
How did it break? What happens when you try to move around and bump into walls?
I figured out i just made a mistake@@bigfatsnakeviiper
i realized i just made a mistake@@bigfatsnakeviiper
Doesn’t work
Well it worked for me...
I think I know a easier way
What would that be?
Move 1 step in direction you want and if touching wall move -1 step
@@bigfatsnakeviiper also about terraria unfinished version, If you want I can sent you the link to scratch profile.
😀😁
2 Is Too Slow
it did not work )=
doesent work
theres a problem the upper collisions make my cat go up even faster instead of stopping it
E
🤫🧏
I know simpler
How to scroll