Discuss Scratch

rockbird153
Scratcher
5 posts

2d top-down collisions

I'm struggling on creating 2D collisions i need help
The_Floppy_Disc
Scratcher
100+ posts

2d top-down collisions

Can you post the link to your project? I do not know what kind of collisions you are trying to make.
rockbird153
Scratcher
5 posts

2d top-down collisions

The_Floppy_Disc wrote:

Can you post the link to your project? I do not know what kind of collisions you are trying to make.
hi its a classic top down non scrolling scratch project so just basic collisions
The_Floppy_Disc
Scratcher
100+ posts

2d top-down collisions

whenclickedforeverifkeyup arrowpressed?thenchangeyby5iftouchingwallsthenchangeyby-5elseifkeydownpressed?thenchangeyby-5iftouchingwallsthenchangeyby5else

Add the rest of the movement code in the else. Make it undo the change if it is touching the wall.
WhaleF1NN
Scratcher
13 posts

2d top-down collisions

perhaps add a repeat until not touching walls change _ by -1/1

Powered by DjangoBB