I'm trying to setup simple bounding box collisions with 4 directional movement. I have a sprite with a bounding box on it, the sprite moves around the screen in 4 directions. I want to setup a series of box's on the screen that the sprite bounding box can collide against. That part is easy enough, but I want the sprite to slide against the edge of the box its colliding with. So if the sprite collides with the box from the side I want the sprite to still be able to move vertically. Any one have any psuedo/code to share?
Thanks
Sliding Sprite Collisions
First, if this is 2D then theres no boxes but squares.
So, really, doing a calculation in one more dimension that you need, is not very wise
The sliding is part of the collision response and not the detection. I recommend you to read about collision response and start your own sliding response, if you get stucked then post the problem and we'll join forces to help you solve it.
I believe its better if you understand the entire process before!.
If you find it too hard, I will post an example of custom 2D collision with sliding response, if it makes anyone happy that is. But you should try first.
So, really, doing a calculation in one more dimension that you need, is not very wise
The sliding is part of the collision response and not the detection. I recommend you to read about collision response and start your own sliding response, if you get stucked then post the problem and we'll join forces to help you solve it.
I believe its better if you understand the entire process before!.
If you find it too hard, I will post an example of custom 2D collision with sliding response, if it makes anyone happy that is. But you should try first.
And yes, "google will provide"

