Discuss Scratch
- TheRealRldFan
-
36 posts
Collision
is it 3D or 2D with pen?
Last edited by TheRealRldFan (March 25, 2024 16:27:42)
- TheRealRldFan
-
36 posts
Collision
What type of game is it, platformer?
Last edited by TheRealRldFan (March 25, 2024 16:26:43)
- Malicondi
-
1000+ posts
Collision
You'll have to be a bit more specific on what you mean by collision, or we won't really be able to help.
- TheRealRldFan
-
36 posts
Collision
Like when you touch something you can’t go past it You'll have to be a bit more specific on what you mean by collision, or we won't really be able to help.
- Wolf_Link21
-
100+ posts
Collision
something like this? https://scratch.mit.edu/projects/989406212/
- ramenecho
-
100+ posts
Collision
Ok so if you want something to collide with an object preventing it from moving past it, im assuming you want it to collide with a form of immovable wall, just make it so every time the sprite moves it checks to see if it is touching the object, and if so then you move with the opposite, example: I just need more examples of Collision with:
I hope this helps!
Last edited by ramenecho (March 25, 2024 17:26:37)
- --CHA0S--
-
100+ posts
Collision
You could break it down a bit further to detect if it was an x collision or a y collision like thisOk so if you want something to collide with an object preventing it from moving past it, im assuming you want it to collide with a form of immovable wall, just make it so every time the sprite moves it checks to see if it is touching the object, and if so then you move with the opposite, example: I just need more examples of Collision with:I hope this helps!
- TheRealRldFan
-
36 posts
Collision
https://scratch.mit.edu/projects/989406212/something like this?
Last edited by TheRealRldFan (March 25, 2024 19:23:43)
- Shrek_em
-
34 posts
Collision
If every wall is going to be the same color (could just be an outline) then the easiest solution is probably
And just copy-paste that if then code for every player input, change the “touching color” to whatever color the thing its colliding with is, and swap out the “change y by” code for “change x by” if it is going horizontal, also make sure to match the “-1” with the speed of the character and remove the “-” if It is going down or left
I think this works idk I'm not sure but if I remember correctly this should work
And just copy-paste that if then code for every player input, change the “touching color” to whatever color the thing its colliding with is, and swap out the “change y by” code for “change x by” if it is going horizontal, also make sure to match the “-1” with the speed of the character and remove the “-” if It is going down or left
I think this works idk I'm not sure but if I remember correctly this should work
- TheRealRldFan
-
36 posts
Collision
thanks If every wall is going to be the same color (could just be an outline) then the easiest solution is probably
And just copy-paste that if then code for every player input, change the “touching color” to whatever color the thing its colliding with is, and swap out the “change y by” code for “change x by” if it is going horizontal, also make sure to match the “-1” with the speed of the character and remove the “-” if It is going down or left
I think this works idk I'm not sure but if I remember correctly this should work
- Shrek_em
-
34 posts
Collision
thanks If every wall is going to be the same color (could just be an outline) then the easiest solution is probably
And just copy-paste that if then code for every player input, change the “touching color” to whatever color the thing its colliding with is, and swap out the “change y by” code for “change x by” if it is going horizontal, also make sure to match the “-1” with the speed of the character and remove the “-” if It is going down or left
I think this works idk I'm not sure but if I remember correctly this should work
no problem!
- TheRealRldFan
-
36 posts
Collision
I am going to follow thanks for the tip!thanks If every wall is going to be the same color (could just be an outline) then the easiest solution is probably
And just copy-paste that if then code for every player input, change the “touching color” to whatever color the thing its colliding with is, and swap out the “change y by” code for “change x by” if it is going horizontal, also make sure to match the “-1” with the speed of the character and remove the “-” if It is going down or left
I think this works idk I'm not sure but if I remember correctly this should work
no problem!