Discuss Scratch

scratchcraft789
Scratcher
20 posts

Wall collisions

I'm making a platformer and I can't work out how to make a wall-collision script, please help. I will give credit to you.
_______________________________________________________________________________________________
This is my current collision script (It's run without screen refresh):
defineCollisions
ifSpeedY>0thenrepeatuntilnottouchingLevel?changeyby-1changeyby1elserepeatuntilnottouchingLevel?changeyby1changeyby-1

MY CURRENT PROJECT:
https://scratch.mit.edu/projects/990080696/

Last edited by scratchcraft789 (March 28, 2024 13:46:10)

MineTurte
Scratcher
1000+ posts

Wall collisions

scratchcraft789 wrote:

I'm making a platformer and I can't work out how to make a wall-collision script, please help. I will give credit to you.
_______________________________________________________________________________________________
This is my current collision script (It's run without screen refresh):
defineCollisions
ifSpeedY>0thenrepeatuntilnottouchingLevel?changeyby-1changeyby1elserepeatuntilnottouchingLevel?changeyby1changeyby-1
Could you share the link as I'm not too sure how your code works. Like what exactly is “speed”. Other than that though it may not work if you aren't hovering like 1 pixel above the floor as the floor counts as the level and won't let you move, If that's one of your problem that is.

Hope I helped!
scratchcraft789
Scratcher
20 posts

Wall collisions

i havent even started the wall collision code btw

Powered by DjangoBB