Discuss Scratch

Intensely_Mellow
Scratcher
3 posts

How do i make collision with a top down game?

Im trying to make a top down scrolling game, but i cant seem to get the collision right. Im trying to get it to where the player is able to push against the walls without going through them, but also able to move along them. In case you're wondering, the “walls” are just a big circle around the map. Does anyone know how to make the sort of collision im looking for?

things ive already tried:
the “last x” and “last y” position collider / it didnt work with the scrolling engine, and even if it did work, i still wouldnt use it because it doesn't let you move along the walls
trying to use a platforming script collider (the one with smooth velocity) / it only works in one direction. (its hard to explain)
I also tried making 4 separate platformer colliders (to solve the problem of it being one directional) that activate when WASD are being pressed. it didnt work either because the avatar would get stuck inside the wall.
potatohead_1011
Scratcher
100+ posts

How do i make collision with a top down game?

C

Intensely_Mellow wrote:

Im trying to make a top down scrolling game, but i cant seem to get the collision right. Im trying to get it to where the player is able to push against the walls without going through them, but also able to move along them. In case you're wondering, the “walls” are just a big circle around the map. Does anyone know how to make the sort of collision im looking for?

things ive already tried:
the “last x” and “last y” position collider / it didnt work with the scrolling engine, and even if it did work, i still wouldnt use it because it doesn't let you move along the walls
trying to use a platforming script collider (the one with smooth velocity) / it only works in one direction. (its hard to explain)
I also tried making 4 separate platformer colliders (to solve the problem of it being one directional) that activate when WASD are being pressed. it didnt work either because the avatar would get stuck inside the wall.
can you share the project
Intensely_Mellow
Scratcher
3 posts

How do i make collision with a top down game?

potatohead_1011 wrote:

can you share the project
np. here it is https://scratch.mit.edu/projects/463118920/

Last edited by Intensely_Mellow (Dec. 15, 2020 00:40:48)

Powered by DjangoBB