games: 60 fps rendering loop + smoother Snake controls

Both games now render at 60 fps independent of the game-logic step rate:
the main loop caps select() at one frame (16 ms) so the screen updates
smoothly even when gravity/snake steps are slow, and renders every frame
or whenever state changed.

Snake: replaced the turn queue with a single buffered direction (latest
keypress wins) so rapid key presses don't queue up and misfire. Base speed
set to 100 px/sec (~90 ms per step) for controllable, responsive play.
Progressive difficulty (+1 px/sec per 5 food) and edge wrap are unchanged.
This commit is contained in:
Luxferre
2026-10-24 08:43:39 +03:00
parent 0abf305dff
commit 9d4ca2e3a6
6 changed files with 52 additions and 43 deletions
Binary file not shown.
Binary file not shown.