Created
June 27, 2013 15:11
-
-
Save colormono/5877275 to your computer and use it in GitHub Desktop.
Efecto Pacman, sale de un lado y aparece por el opuesto.
This file contains 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
void checkEdges() { | |
if (location.x > width) { | |
location.x = 0; | |
} else if (location.x < 0) { | |
location.x = width; | |
} | |
if (location.y > height) { | |
location.y = 0; | |
} else if (location.y < 0) { | |
location.y = height; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment