Physics for moving blocks
- by Gabson
I'm working on a 2D game for windows phone where the player moves blocks around to bounce a laser beams.
I need to create some simple physics for moving the blocks.
For the moment I have a simple collision class, telling me if two rectangles collide. But that's not enough because when I'm moving a block the rectangle/rectangle function doesn't work.
By Doesn't work i mean,I manage the collision but I don't how to stop the block mooving while the user sliding the block.
The collision response for the block I want is if the user tries to slide it on another object, the block should slide up against the other object and not overlap.
How would I go about implementing this functionality?