Question about using box2d in bomberman style game

Hello,

I am creating a simple bomberman style game to play with some html5 game frameworks. I was writing some simple collision code when it was suggested that I use box2dweb to handle all my collisions for me.

There is a couple of things I'm not sure how I would do using box2d, if anyone could help me out that would be great.

- if you "lay" a bomb when not moving it appears underneath you and until you step off it you do not want to collide with it. Once you step off the bomb you can no longer walk through it, but if you have a kicking powerup you can move it.

I'm guessing I could do this with a collision filter and a sensor so the bomb and the player don't collide until sensor contact ends, once the collision ends remove the bomb from the players group so it interacts with the player again. I'm not sure how I could make it so that no collision effect happens unless you have the powerup?

- kicking a bomb, when you have a kicking powerup it causes the bomb to move when you walk into it, this works easily and when the bomb hits a player it stops. But it doesn't have to hit a player to stop, if a player is partially covering a square of the map the bomb would stop one square earlier.

I'm not sure how I could do this either, I could cover the map with sensors on each grid square and then "activate" a sensor when a player is standing on it such that I can then stop the bomb when it collides with the sensor. Would there be an easier way to do this?


Is using such a complete physics library like box2d for this functionality a good idea, or is it easier to create some custom collision detection code based of the games rules?


Thanks for any help

Original thread: https://box2d.org/forum/viewtopic.php?t=9188