[Resolved] Top Down Roguelike Collison Issues

Hello all, I am trying to figure out why the walls in my 80s roguelike project don’t seem to have collision on the right and top sides.

The walls should work as any normal old wall, however collision only seems to activate from the bottom and from the left side of said walls.

I am rather new to GDevelop, so it may be me just forgetting something very simple.

ezgif.com-video-to-gif-converter

Here is what I am referring to. You can see how my character can just seemingly phase through walls.

Thanks!

Also, I suspect it may have something to do with the movement. I am moving at 16px per press, a full in-game tile.

However, when I set it to 15px per press, there is full collision on every side.

Add to your player 4 points
EACH 9 pixels from center in one of up down left right direction
And well name them up down left right

Now you add condition point is inside object and set it to wall
And invert it
And use it in event where you allow movement

So for example for in event where you have condition up key pressed and action move up you add condition
INVERTED point Player.PointX(“Up”) Player.PointY(“Up”) is inside wall

Now you do the same for other directions

If you want something more to block player than walls just make object group called obstacles and put it there
And now you can check instead if point is inside Obstacles

Can you provide a screen shot of your collision and movement events?

Yes, sorry. Everything is the same as last night, except I changed the all tiles and readjusted assets to 64px. Still having the same collision issues.

You’re best to implement what @ZeroX4 suggested:

-create 4 points a few pixels outside the player sprite (to the top, bottom, left and right)
-name each one appropriately (“up”, “down”, “left” and “right”)
-in each key pressed event, add the condition that the relevant point is not inside the cosmos_tilemap object.

1 Like

Hey, big thanks to you @MrMen and @ZeroX4 for helping noobs like me through. It’s working now!!

2 Likes