Obstacle with a Sprite

I’m making an RPG game now and there is some furniture(sprites) in my game.

I had already made a hitbox for the player.

The problem is I don’t want the player go through the furniture, but I found that the wall in tilemap doesn’t works well. The wall is always a bit bigger or smaller than I need.

Is there a nice way to make a sprite works like a wall?

You could use the on sprite of kind player overlaps other sprite of kind enemy to set the location of player to just outside it every time

1 Like

But it’s hard (maybe for me) to check the collision direction so I cant figure how to set the location to outside :frowning:

You can just use the player velocityX and Y to tell the direction. It doesn’t look very good though :face_with_diagonal_mouth:
https://makecode.com/_fEH6A7CDo46b

Finally, I solved this problem with adding 4 hitrods in 4 directions to detect the collision direction with furnitures. I also added hitboxes for furnitures to make collision looks naturally.
tks for u guys for your useful advice :slight_smile:

2 Likes