diff --git a/overlay/rootfs/usr/bin/snake b/overlay/rootfs/usr/bin/snake index ed4eb61..c8bf935 100755 Binary files a/overlay/rootfs/usr/bin/snake and b/overlay/rootfs/usr/bin/snake differ diff --git a/overlay/rootfs/usr/bin/tetris b/overlay/rootfs/usr/bin/tetris index 3d8790f..ead3fdd 100755 Binary files a/overlay/rootfs/usr/bin/tetris and b/overlay/rootfs/usr/bin/tetris differ diff --git a/prebuilt/games/usr/bin/snake b/prebuilt/games/usr/bin/snake index ed4eb61..c8bf935 100755 Binary files a/prebuilt/games/usr/bin/snake and b/prebuilt/games/usr/bin/snake differ diff --git a/prebuilt/games/usr/bin/tetris b/prebuilt/games/usr/bin/tetris index 3d8790f..ead3fdd 100755 Binary files a/prebuilt/games/usr/bin/tetris and b/prebuilt/games/usr/bin/tetris differ diff --git a/src/games/snake.cpp b/src/games/snake.cpp index 49f49b0..5744a0c 100644 --- a/src/games/snake.cpp +++ b/src/games/snake.cpp @@ -107,7 +107,7 @@ static int foodx, foody; static int score = 0; static int best = 0; static int speed = 90; // ms per step (derived from pps below) -static int pps = 100; // base speed px/sec; +1 px/sec per 5 food eaten +static int pps = 150; // base speed px/sec; +1 px/sec per 5 food eaten static unsigned long nextTick = 0; static bool running = true; static unsigned long now_ms() { @@ -165,7 +165,7 @@ static void reset_game() { dirx = 1; diry = 0; ndirx = 1; ndiry = 0; score = 0; - pps = 100; + pps = 150; update_speed(); place_food(); state = PLAYING; @@ -202,7 +202,7 @@ static void step() { score += 10; if (score > best) best = score; int food = score / 10; // food items eaten so far - pps = 100 + food / 5; // +1 px/sec per 5 food eaten (progressive difficulty) + pps = 150 + food / 5; // +1 px/sec per 5 food eaten (progressive difficulty) update_speed(); place_food(); } @@ -375,7 +375,7 @@ int main() { render(); int xfd = ConnectionNumber(dpy); - const unsigned long FRAME_MS = 1000 / 60; // 60 fps rendering + const unsigned long FRAME_MS = 1000 / 30; // 30 fps rendering unsigned long lastFrame = now_ms(); while (running) { diff --git a/src/games/tetris.cpp b/src/games/tetris.cpp index 86b0d81..d19bfb4 100644 --- a/src/games/tetris.cpp +++ b/src/games/tetris.cpp @@ -499,7 +499,7 @@ int main() { render(); int xfd = ConnectionNumber(dpy); - const unsigned long FRAME_MS = 1000 / 60; // 60 fps rendering + const unsigned long FRAME_MS = 1000 / 30; // 30 fps rendering unsigned long lastFrame = now_ms(); while (running) {