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:
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user