Box2D grid based collision

Viewed 778

First let me quickly tell what I am trying. I am doing tetris-like game using Box2D, I know Box2D is maybe not the best option in this case, but I really need to have normal physics also because the levels have obstacles and if you hit them blocks are supposed to rotate.

Here is image to demonstrate what I mean.

enter image description here

Case 1: This is how I want it to be.

Case 2: This was one of my ideas, just to make the block size of falling piece little bit smaller so they fit nicely into the empty space. As expected problem with this was the empty space around the block. Making it look like box doesn't belong there.

Case 3: Keeping the block size of falling piece same as "wall" block size it never makes it to the empty space, because edges collide and it stays like that.

so how can I make it fit in empty space filling it and without looking weird?

EDIT: If I make size of the falling object smaller it wont work in this case: enter image description here

And here is image to demonstrate what kind of behavior I want:

enter image description here

1 Answers
Related