Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Collision detection for list platformer
- helloworldbyeworld
-
Scratcher
1000+ posts
Collision detection for list platformer
Hello,
I'm making a platformer with 100% list graphics in which the ground and platforms are displayed as a dotted Unicode block character. I tried making a function that detects the characters around the player block and not let the player accelerate if it detects a platform character in the player's way, but that does not seem to prevent sliding on top of platforms.
Here's the x movement script (the attempt to prevent the player from sliding up is circled in black):

And here's the link to the project:
https://turbowarp.org/630346674
The surrounding block detection function is named “Check surrounding items of (x, y)”.
I'm making a platformer with 100% list graphics in which the ground and platforms are displayed as a dotted Unicode block character. I tried making a function that detects the characters around the player block and not let the player accelerate if it detects a platform character in the player's way, but that does not seem to prevent sliding on top of platforms.
Here's the x movement script (the attempt to prevent the player from sliding up is circled in black):

And here's the link to the project:
https://turbowarp.org/630346674
The surrounding block detection function is named “Check surrounding items of (x, y)”.
Last edited by helloworldbyeworld (Jan. 22, 2022 18:44:49)
- helloworldbyeworld
-
Scratcher
1000+ posts
Collision detection for list platformer
Bump! Bump! Bumpy bump!
- Discussion Forums
- » Help with Scripts
-
» Collision detection for list platformer
