Discuss Scratch

Bigmemer87
Scratcher
3 posts

How do you make a collision engine for a 2D map?

I'm making a 2D Backrooms game, and need a collision engine between the player and the walls. I was hoping some other more experienced Scratchers' could teach me some tricks on this.

Last edited by Bigmemer87 (Yesterday 00:33:33)

mastercoder_pa
Scratcher
6 posts

How do you make a collision engine for a 2D map?

I can… So, my question was, could you explain a bit more on-
Your game
How it works
It would be great if you could just share it once and comment the link on my profile so I can check it out and reply tight here on how you can improve.
Bigmemer87
Scratcher
3 posts

How do you make a collision engine for a 2D map?

alright, I'll get it ready
Bigmemer87
Scratcher
3 posts

How do you make a collision engine for a 2D map?

Commenting on your profile has been turned off
awesome-llama
Scratcher
1000+ posts

How do you make a collision engine for a 2D map?

The simplest form of collision handling is probably just to move only when there is available space. You can move the player, check if it is touching a wall, and if it is, move it back.

e.g.

if <key [right arrow v] pressed?> then
change x by (5)
if <touching [wall v] ?> then
change x by (-5)
end
end

Powered by DjangoBB