1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 13:09:49 +04:00

Snake: Allow food to spawn anywhere

food was only spawning on old snake path from previous firmware versions, now it can spawn on each pixel on new snake path
This commit is contained in:
TQMatvey
2022-10-24 09:31:18 +07:00
committed by GitHub
parent 64ecdce5ca
commit d159c56e28

View File

@@ -196,8 +196,8 @@ static Point snake_game_get_new_fruit(SnakeState const* const snake_state) {
if((buffer[y] & mask) == 0) { if((buffer[y] & mask) == 0) {
if(newFruit == 0) { if(newFruit == 0) {
Point p = { Point p = {
.x = x * 2, .x = x,
.y = y * 2, .y = y,
}; };
return p; return p;
} }
@@ -406,4 +406,4 @@ int32_t snake_game_app(void* p) {
free(snake_state); free(snake_state);
return 0; return 0;
} }