Aug 7, 2012 at 7:31 AM
Edited Aug 7, 2012 at 7:35 AM
I'm trying to make a tile engine, but bodies that are not colliding with a sprite are still having an effect on it.
In this image there is a single sprite(the green box) with a ground detecting fixture and a single tile. The sprite rests right up against the tile like it should but the fixture attached to the sprite does not collide with the tile.
and in this one there are 2 tiles. The sprite is not colliding with the tile on the right, but when the tile is placed the sprite moves a few pixels upwards. Then when the tile is removed, the sprite falls back down and everything is fine again. Also, when
the second tile is there, the fixture attached to the sprite does collide with the correct tile (the one on the left).
I have gone through the debugging, everything has the values I would expect, the debug view shows everything is fine and my OnCollision method is only being called by the tile that is actually colliding with the sprite.
The only thing I'm doing that might not be "normal" is reusing bodies for the tiles near the sprite and just moving their positions every frame (I'm 100% they're being moved to the correct locations). Could this be causing the problem somehow?