Files
bananarchy/prebuilt/games/usr/bin/tetris
T
Luxferre eee12181c7 games: responsive game loop with non-blocking input polling
Replaced the blocking select()-based main loop with a proper game loop:
- Process ALL pending X11 input (XPending) before every frame — no more
  missed keypresses from select() blocking for up to a full frame
- Render every frame at 30 fps (FRAME_MS = 33 ms) consistently
- Frame pacing uses select() with a timeout that wakes immediately on
  input, so keypresses are processed within milliseconds
- Game logic (snake steps, tetris gravity) still runs at its own rate via
  nextTick, decoupled from render rate

This eliminates input lag and missed keypresses in both Snake and Tetris.
2026-10-24 09:03:38 +03:00

17 KiB
Executable File