Created
February 15, 2020 04:26
-
-
Save parzibyte/7a1261cbf6506995a3c637af832808f9 to your computer and use it in GitHub Desktop.
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
// Saber en dónde está la comida para, más tarde, saber si la serpiente colisiona | |
int comidaX, comidaY; | |
// El puntaje. Se desborda cuando llega a 32767, creo | |
int puntaje = 0; | |
bool colisionaConComida() { | |
return serpiente[0].x == comidaX && serpiente[0].y == comidaY; | |
} | |
void loop() { | |
// ... | |
if (colisionaConComida()) { | |
puntaje++; | |
randomizarComida(); | |
agregarPedazo(0, 0);// De hecho la posición del pedazo no importa al momento de agregar | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment