Robin wrote:In which case, you don't really need collision detection, just something simpler to check for walls and stuff.
Yes, I forgot to mention that too. In a bomberman style game, your movement is restricted (I think - I have not played that for years).
With the movement restrictions, you don't need a collision detection like bump. You can use the map itself, because the players only "occupy" one tile on each frame. So before moving to the left, you just have to ask "is the cell to my left free"? And allow movement only in that case.
To implement movement restrictions, you have to make your player "commit" to a movement. If you are in one cell and you press "left", the player will keep moving horizontally until you reach the center of the next cell
. You can't move "up" or "down", even if they are empty too (you might allow moving back to the right). Once the next center is reached, the player is free to choose another direction. The player is always "aligned with the center of the tiles", at least in one axis. "The cell where the player is standing" is decided by looking at the point in the center of the player's feet.
Doing this in LÖVE is a bit tricky because of dt. If the "center" of a tile is at x=10, in one frame you can be at x=9.55 and on the next one you are at x=10.01, so you have to know "I am moving right and the player is not pressing right any more, so I will stop at x=10 instead of x=10.01".
You don't need to restrict your movement like that if you use bump (but you need to make the player smaller). It won't be exactly
like the classical bomberman, but it will also be easier to program IMHO. Your players can be in 4 tiles simultaneously, which would make the kills a bit more realistic too.