Soft-drop: replace OS key-repeat with game-loop tick (W / down-arrow held) #31
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/cellblock#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom (operator playtest, 2026-06-21 ~13:10)
Holding W or the Down arrow during a solo run drops the piece once, then nothing happens for ~500ms (OS auto-repeat delay), then drops resume at the OS auto-repeat rate. Not the smooth accelerated descent expected of soft-drop in a Tetris-family game.
Operator wording: "the W/Down arrow key lowers the block only once. Then the long key press delay blocks any additional inputs, and only after some delay the block starts to drop in increased speed."
Root cause
Soft-drop is currently driven by OS-level key-repeat events (one initial keydown + a hardware-controlled delay + hardware-controlled repeat rate). This makes the soft-drop feel laggy and inconsistent — it depends on the player's OS settings rather than the game's tick.
Fix direction
Replace OS-auto-repeat-driven soft-drop with game-loop-tick-driven soft-drop:
softDropHeld: booleanstate fromkeydown→keyupon W / Down-Arrow (independent of OS auto-repeat).softDropHeld === true, advance the piece downward at the soft-drop rate (e.g. 1 row per ~30ms, ordropInterval / softDropMultiplier).keydownevents for the same key while it's held (no re-trigger from OS auto-repeat —event.repeatfilter, or simply key-state tracking).Reference behavior: classic Tetris guidelines (TGM, NES, modern guideline) all use game-tick soft-drop, not OS auto-repeat.
Acceptance criteria
Lane
Shipwright — render-side / game-loop / input-handling.
Effort
Size/S — a focused input-handler refactor with one new piece of per-frame state. Mostly localized to wherever the existing soft-drop handler lives.