Claude/nice feynman tg0ocy#41
Merged
Merged
Conversation
Adds swimming to the Kit player controller, mirroring the Wave 2 ladder/climb system. A new b2kPlayerAddWater x1,y1,x2,y2 registers a polled water zone (world state, wiped by b2kClear, like ladders). While the player's centre is submerged the controller SWIMS: - gravity drops to swimGravity (default 0.35) so you sink slowly, - the sink caps at swimMaxFall (150) -- far below the air terminal, - UP/DOWN swim at swimSpeed (150), and a JUMP press is a repeatable upward STROKE (swimJump 300) with no ground gate (the water jump), - a new "swim" state + a swim anim slot (b2kPlayerAnims 9th arg, falls back to the fall pose), so alien swim1/2 art drives true. Mutually exclusive with the climb (the tick starts only one); leaving the zone or being hurt restores the saved gravity scale. The swim path costs one compare per frame when no water zones exist. Harness v11: stTestSwim drives a paused, hand-stepped player through a deep pool -- dive-in enters swim, the neutral sink is capped low, a stroke bursts upward, UP swims up, leaving restores gravity. Every value is printed so a scale/arithmetic miss self-reports. Embedded Kit re-synced into all examples. https://claude.ai/code/session_012A6Dqdr3DPCeC3oWZohjHi
The micro-game gains a third level built on the new swim feature: a wide pool you DIVE into, with every coin underwater so the door makes you swim. The alien skins now wire their real swim1/swim2 frames (b2kPlayerAnims' new 9th arg); the embedded hero falls back to the fall pose. New data verbs in the level interpreter: - water l,t,r,b -- a b2kPlayerAddWater swim zone drawn as a blue pool with a surface line (coins/fish layer on top). - fish x,yTop,yBot,period -- a pit-dweller: a bodiless vertical bobber (the sweep pattern on the y axis) that breaches and dives, a knockback graze on contact (never a respawn -- the Wave 2 hazard split). The level forces the swim mechanic: 4 coins underwater + 1 on the far bank, so the only way to open the door is to dive, swim for them (dodging the fish), and stroke up + hold-right to HOP out onto the far bank. The game now runs three levels (mgAdvance/mgGoNext generalised; the win says "all three levels"). Static gates pass. Awaiting an OXT pass for the swim feel + alien art. https://claude.ai/code/session_012A6Dqdr3DPCeC3oWZohjHi
CHANGELOG, the plan.md decision log, and the expansion-prep status table now reflect the Wave 4 SWIM feature (Kit + harness v11, Opus-reviewed clean) and the micro-game's L3 water level. Wave 4 is marked IN PROGRESS; the platformer water beat (needs a raised-bank basin) and the collapsing-bridge trap are the pending items. https://claude.ai/code/session_012A6Dqdr3DPCeC3oWZohjHi
A final optimization/layout/logic pass on the Wave 4 micro-game content (Opus-audited: no blockers, all reachability + harness thresholds pass with margin). - OPTIMIZATION: b2kFrame read b2kPosition(gHero) for the kill plane, and mgTickSweeps + mgTickFish each re-read it -- a needless FFI round-trip per frame (the "one hero snapshot per frame" law). Now b2kFrame reads it once and passes (hx,hy) into both ticks. - LOGIC/visual: the L3 pit-dweller fish bobbed 44px BELOW the surface despite its "breaches the surface and dives" billing -- its top moved from y404 to y340 so it actually leaps clear of the water line. Static gates clean. The Kit swim mode, the harness v11 test, and L3's reachability were re-audited and confirmed sound for the OXT pass. https://claude.ai/code/session_012A6Dqdr3DPCeC3oWZohjHi
The swim feature moves to the platformer -- the level the user actually play-tests. L1 GREEN HILLS gains a HILLTOP POOL past the crusher alley: a RAISED swim basin between two earth banks (the 640-tall world clamps the camera at y640, so a swim pool can't be a sub-ground pit -- it's a basin held up at the surface, the same reason the micro-game raised its land). You hop onto the left bank, DIVE in, swim DOWN for three underwater coins (the gate can only clear by swimming them), then stroke up + hold-right to HOP out the far bank and on to the flag. New pfMakeWater helper draws the zone + water; swimSpeed/swimJump are set for the bigger 88px capsule and the bank height. The character_beige sheet has no swim frame, so the swim state falls back to the fall pose (mechanic over art -- as agreed). Harness v12 adds the two gaps the play-tested games exposed: - stTestSwimGrounded: SWIM while RESTING on a submerged floor (the pool floor) -- still in the swim state, and a stroke lifts off with no grounded-jump gate. - stTestSwimClear: the LEVEL-REBUILD path -- b2kClear must wipe the water zone (via b2kPlayerForget), or the next level's player is born swimming in mid-air where the old pool was. Zones are world state. Static gates clean across all 8 scripts. https://claude.ai/code/session_012A6Dqdr3DPCeC3oWZohjHi
Pressing "0" on level 1 drops the hero onto the pool's left bank so the swim beat is reachable without replaying the level -- fast iteration on swim feel. Gated to level 1 and a live hero; clearly fenced with a delete-before-merge sentinel. https://claude.ai/code/session_012A6Dqdr3DPCeC3oWZohjHi
Per playtest, the pool felt too floaty -- you could pop straight out. swimGravity (the between-stroke sink) goes 0.35 -> 0.6 and swimMaxFall 150 -> 200 so the water feels weighty; swimJump (the stroke, which alone sets the escape height since it sets velocity directly) trims 360 -> 300 so you must swim to a bank and stroke to climb out rather than bob up. All four remain b2kPlayerSet knobs in pfStartGame, live for tuning. https://claude.ai/code/session_012A6Dqdr3DPCeC3oWZohjHi
The bonk DID fire (confirmed in playtest), but the player's head stopped well below the brick. Cause: the 128px character frame is bottom-aligned with headroom, so the 88px capsule topped out ABOVE the visible head -- the invisible "hat" hit the brick while the visible head sat ~12px low. Shrink the hitbox to match the art (tH 88 -> 76) with tDY derived so the FEET stay planted, and make the bonk window read the real half-height (gHeroHalfH) instead of a hardcoded 44 -- so the head reaches the brick and the smash reads as contact. The capsule is the only physics change; feet, jump and the bonk window are unchanged in effect. tH is the single tuning knob (tDY + gHeroHalfH follow it) if the fit needs a nudge. https://claude.ai/code/session_012A6Dqdr3DPCeC3oWZohjHi
Bring every doc current with the swim feature and the playtest round, log what this wave taught, and prepare the next wave. - CLAUDE.md: gotcha 28 (a hitbox taller than the visible sprite makes the head bump things it never touches — the brick gap); a Liquids/SWIM layout law (a swim pool is a RAISED basin, not a sub-ground pit; and swimGravity sets only the sink while swimJump alone sets the escape); harness ref -> v12 / ~125 assertions. - kit-reference + kit-guide: the swim action, b2kPlayerAddWater, the swim state + the b2kPlayerAnims 9th slot, the four swim knobs, and a swim subsection in guide section 21 (+ API index). - CHANGELOG: the Wave 4 entry repointed from the (set-aside) micro-game L3 to the platformer hilltop pool, with the swim-weight + brick-hitbox fixes and harness v12. - expansion-prep: status table updated (swim play-tested in the platformer; L3 + collapsing bridge as carry-overs); new section 11 (Wave 4 as-built) and section 12 (Wave 5 design: wall-slide/jump, dash, double-jump, duck reshape) so the next wave is ready to start. - plan.md decision log + README + game-engine-spec brought in line. Docs-only; static gates still pass (no script touched). https://claude.ai/code/session_012A6Dqdr3DPCeC3oWZohjHi
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.
No description provided.