Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Walls and bottom of platform
- COCOCANINBSS
- Scratcher
31 posts
Walls and bottom of platform
how can I make walls and bottom of a platform work
https://scratch-mit-edu.ezproxy.canberra.edu.au/projects/1080267369/
https://scratch-mit-edu.ezproxy.canberra.edu.au/projects/1080267369/
- knightjj11
- Scratcher
100+ posts
Walls and bottom of platform
I think you may have forgotten to share the project or you may have taken it down. Could you reshare it?
- Jason a.k.a Knightjj11
- COCOCANINBSS
- Scratcher
31 posts
Walls and bottom of platform
I was getting no responses so I unsared it but I will reshare it now!
- COCOCANINBSS
- Scratcher
31 posts
Walls and bottom of platform
I also need help with basically all collision lol
- Jareddddddd
- Scratcher
1000+ posts
Walls and bottom of platform
Hi, you need to merge all scripts under the same hat, so you can be sure of the order in which they are run. As for the collision itself, you can simply reset the X/Y and move the negative amount of it.
If you want interpolated collision, use the equation of (x/abs(x)) to get the sign of the vel and iterate until you are outside of the wall.
If you want interpolated collision, use the equation of (x/abs(x)) to get the sign of the vel and iterate until you are outside of the wall.
⠀⡇⠀⠀⠀⢀⡶⠛⣿⣷⡄⠀⠀⠀⣰⣿⠛⢿⣷⡄⠀⠀⠀⢸
⠀⡇⠀⠀⠀⢸⣷⣶⣿⣿⡇⠀⠀⠀⢻⣿⣶⣿⣿⣿⠀⠀⠀⢸⠀
⠀⡇⠀⠀⠀⠈⠛⠻⠿⠟⠁⠀⠀⠀⠈⠛⠻⠿⠛⠁⠀⠀⠀⢸
ssssssssssssssssssssssssssssssssss (shift+down)
*⠀*⠀*⠀*⠀*⠀*⠀*⠀*⠀*⠀*⠀*
|⠀ |⠀ |⠀ |⠀ |⠀ |⠀ |⠀ |⠀ |
day in and day out I watch.
i am but a shell,
a construct to his plan.
and you,
a coward wearing the cloth of diamond.
do not falter now.
- Imakegamesalot
- Scratcher
41 posts
Walls and bottom of platform
I'm not great with platformers, but I think you have to do the thing where its like
I'm not sure how many times you repeat it but in all of my working platformers this is what keeps the little dude from sinking
forever
if <touching [ground or whatever you're using for ground]> then
change y by (1)
if <touching [ground or whatever you're using for ground]> then
change y by (1)
if <touching [ground or whatever you're using for ground]> then
change y by (1)
if <touching [ground or whatever you're using for ground]> then
change y by (1)
if <touching [ground or whatever you're using for ground]> then
change y by (1)
if <touching [ground or whatever you're using for ground]> then
change y by (1)
if <touching [ground or whatever you're using for ground]> then
change y by (1)
end
end
end
end
end
end
end
end
I'm not sure how many times you repeat it but in all of my working platformers this is what keeps the little dude from sinking
Last edited by Imakegamesalot (Oct. 16, 2024 22:25:07)
When <finished reading::motion> my (stellar::looks) post:: hat events
say [Where is her signature?]
.(::custom) ( ::custom) .::grey
___________::custom
- Discussion Forums
- » Help with Scripts
- » Walls and bottom of platform