Created
June 11, 2013 00:09
-
-
Save jpleau/5753572 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check collision for X: | |
If there's collision, xVelocity = 0 | |
Check colision for Y: | |
If there's collision, yVelocity = 0 | |
If there was a collision on X but not on Y, check if the top or bottom (depending on our position) is free, and if yes, yVelocity = -1 or 1 (depending on our position vs the box that we collided on) | |
If there was a collision on Y but not on X, check if the left or right (depending on our position) is free, and if yes, xVelocity = -1 or 1 (again depending on our position vs the box that we collided on) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment