blocks: level-based gravity so it starts slow and speeds up per level - #17
Open
ebadger wants to merge 1 commit into
Open
blocks: level-based gravity so it starts slow and speeds up per level#17ebadger wants to merge 1 commit into
ebadger wants to merge 1 commit into
Conversation
Block Drop fell uniformly too fast because gravity used a fixed 8-bit
ldx #PACE counter, which caps the period at ~0.06 s/row no matter the
value. Replace it with a 16-bit gravity countdown reloaded each row from a
per-level pace table (PACE_TBL), so the fall starts gentle and accelerates.
* Level rises with lines cleared (LINES_PER_LEVEL = 5, capped at 15) and is
shown as LVL:nn on the status row.
* Pace curve (calibrated against the emulator's ~1.02 MHz clock and verified
headlessly): level 1 ~0.80 s/row -> level 15 ~0.09 s/row.
* blocks.test.mjs gains section E (level display, monotonic pace ramp, and a
timed level-1 row confirming the slowdown); gravity/accumulation checks now
force a fast level via pokes so they stay quick.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Block Drop previously fell far too fast (~0.036 s/row, ~28 rows/sec) and never changed speed, because gravity used an 8-bit
ldx #PACEcounter whose period is capped at ~255 iterations.This replaces it with a 16-bit per-level pace table so the game starts slow and speeds up as you clear lines:
gravL/gravH) reloaded each row fromPACE_TBL_L/H, indexed by a newlevelvalue.levelrises every 5 cleared lines (capped at 15); shown asLVL:nnon the status line.Verification:
node codegen/tools/blocks.test.mjs— all sections pass, including new section E which times the level-1 fall (~0.81 s/row) and checks the curve is monotonic.?srcload) passes.emulator/AICodeGen/blocks/blocks.prgandweb/programs/blocks.prg, byte-identical) and updated the prompt/README docs.The change was originally committed onto
star-swarm, whose PR (#16) was already merged; this moves the single fix commit onto its own branch for review.Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com