Skip to content

Instantly share code, notes, and snippets.

@colormono
Created June 27, 2013 15:11
Show Gist options
  • Save colormono/5877275 to your computer and use it in GitHub Desktop.
Save colormono/5877275 to your computer and use it in GitHub Desktop.
Efecto Pacman, sale de un lado y aparece por el opuesto.
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