From 1d1c4524de6ce7c8f9e4f07e3a88c208ca1d1fbc Mon Sep 17 00:00:00 2001 From: Luxferre Date: Sat, 24 Oct 2026 09:41:42 +0300 Subject: [PATCH] games: revert to 60 fps, slower Snake base speed Switched both games back to 60 fps (FRAME_MS = 16 ms) for smoother rendering and reduced Snake base speed from 150 to 90 px/sec (~60 ms -> ~100 ms per step at cell=9) so the snake is controllable and doesn't feel too fast. Progressive difficulty (+1 px/sec per 5 food) and turn queue are unchanged. --- overlay/rootfs/usr/bin/snake | Bin 13716 -> 13716 bytes overlay/rootfs/usr/bin/tetris | Bin 17812 -> 17812 bytes prebuilt/games/usr/bin/snake | Bin 13716 -> 13716 bytes prebuilt/games/usr/bin/tetris | Bin 17812 -> 17812 bytes src/games/snake.cpp | 10 +++++----- src/games/tetris.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/overlay/rootfs/usr/bin/snake b/overlay/rootfs/usr/bin/snake index 7961641a7da94344f06e699c60f5ad26e317c4c1..4f100a5ffa31a09e4fcc87fd8d47196f2f4a5e6d 100755 GIT binary patch delta 346 zcmV-g0j2(wYm{rSWC0ZF*u3732U1p3f%vIFq*vtWVvabocmc2j0a3Fl1>+0>53>yt z!vO&hv(Xa|0s&gH;T3xce>O-2BXG5buy{mI^m=wQOf*e3Nqj^>SOFm4?I!K4OWhg5lVYt62BP(J5_v8EkA!tUSW&ZbMJ?;RTPxN|n-RS}W z1N#Q{03-hQc+0>AhQh; z!vO&yv(Xa|0s)q@;T3xce>6x0Bk;9{uy{mI^m=zPOaLV^PBKY+L_t{J?ItVV?I%0m z?I;W1?I|06L@i1QXa$i^@Bje;A$mmfU?XTk`QIwS?F0+L?FJhM`vdc_U`X<{62bOP zGJ^X965AKU>mn0nVkj#mWw^g6BQs$oVgL8!{H0|nMrcO<_h#+@HJwlNdU60G-RS}W z{`Y+D2m1vDGiek`D@1xkBW4gw(^wj41)EwxPw)T(0nrDr@V)-`Ztjy9AS4mWAOHY* zAOHZ|0000GApigzlT9EqlW-sivw$FR0|=`IfK>ede*v=rBm)YQa3Bbi1THKANwYC7 ouK@u`li@Ej0a~*aFgpVQK$B539|lMu002lJlm0Rmvy3wc0wwZ*!T^ycOXs(UMK!#;Qjg#O`{*4oL0<;f-ewR}deX0vz!&=LV4vq=;e0s$ej HVHPtl`nVE> diff --git a/prebuilt/games/usr/bin/snake b/prebuilt/games/usr/bin/snake index 7961641a7da94344f06e699c60f5ad26e317c4c1..4f100a5ffa31a09e4fcc87fd8d47196f2f4a5e6d 100755 GIT binary patch delta 346 zcmV-g0j2(wYm{rSWC0ZF*u3732U1p3f%vIFq*vtWVvabocmc2j0a3Fl1>+0>53>yt z!vO&hv(Xa|0s&gH;T3xce>O-2BXG5buy{mI^m=wQOf*e3Nqj^>SOFm4?I!K4OWhg5lVYt62BP(J5_v8EkA!tUSW&ZbMJ?;RTPxN|n-RS}W z1N#Q{03-hQc+0>AhQh; z!vO&yv(Xa|0s)q@;T3xce>6x0Bk;9{uy{mI^m=zPOaLV^PBKY+L_t{J?ItVV?I%0m z?I;W1?I|06L@i1QXa$i^@Bje;A$mmfU?XTk`QIwS?F0+L?FJhM`vdc_U`X<{62bOP zGJ^X965AKU>mn0nVkj#mWw^g6BQs$oVgL8!{H0|nMrcO<_h#+@HJwlNdU60G-RS}W z{`Y+D2m1vDGiek`D@1xkBW4gw(^wj41)EwxPw)T(0nrDr@V)-`Ztjy9AS4mWAOHY* zAOHZ|0000GApigzlT9EqlW-sivw$FR0|=`IfK>ede*v=rBm)YQa3Bbi1THKANwYC7 ouK@u`li@Ej0a~*aFgpVQK$B539|lMu002lJlm0Rmvy3wc0wwZ*!T^ycOXs(UMK!#;Qjg#O`{*4oL0<;f-ewR}deX0vz!&=LV4vq=;e0s$ej HVHPtl`nVE> 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) {