diff --git a/overlay/rootfs/usr/bin/snake b/overlay/rootfs/usr/bin/snake index 7961641..4f100a5 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 770f32c..0f34ed5 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 7961641..4f100a5 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 770f32c..0f34ed5 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 713e587..8c9cad9 100644 --- a/src/games/snake.cpp +++ b/src/games/snake.cpp @@ -107,8 +107,8 @@ static int tqn = 0; // number of queued turns 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 = 150; // base speed px/sec; +1 px/sec per 5 food eaten +static int speed = 100; // ms per step (derived from pps below) +static int pps = 90; // 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() { @@ -166,7 +166,7 @@ static void reset_game() { dirx = 1; diry = 0; tqn = 0; score = 0; - pps = 150; + pps = 90; update_speed(); place_food(); state = PLAYING; @@ -224,7 +224,7 @@ static void step() { score += 10; if (score > best) best = score; int food = score / 10; // food items eaten so far - pps = 150 + food / 5; // +1 px/sec per 5 food eaten (progressive difficulty) + pps = 90 + food / 5; // +1 px/sec per 5 food eaten (progressive difficulty) update_speed(); place_food(); } @@ -407,7 +407,7 @@ int main() { render(); int xfd = ConnectionNumber(dpy); - const unsigned long FRAME_MS = 1000 / 30; // 30 fps rendering + const unsigned long FRAME_MS = 1000 / 60; // 60 fps rendering unsigned long frameStart = now_ms(); while (running) { diff --git a/src/games/tetris.cpp b/src/games/tetris.cpp index a7b7e1e..f539ac2 100644 --- a/src/games/tetris.cpp +++ b/src/games/tetris.cpp @@ -520,7 +520,7 @@ int main() { render(); int xfd = ConnectionNumber(dpy); - const unsigned long FRAME_MS = 1000 / 30; // 30 fps rendering + const unsigned long FRAME_MS = 1000 / 60; // 60 fps rendering unsigned long frameStart = now_ms(); while (running) {