Power-up drops: Magnet, Double Jump, Bubble Shield - #8
Merged
Conversation
Stomped enemies now drop a glowing capsule on a 25% roll (single injectable Math.random draw decides drop + type uniformly): - Magnet (8 s): crystals within 150px home in at 520px/s - Double Jump (15 s): one extra air jump, 600px/s impulse, resets on landing - Bubble Shield: absorbs the next hit, grants half invulnerability, no heart lost Capsules bob and glow in the world, blink in their final 2 seconds, and evaporate with a poof after 10 s. Active effects show as HUD chips under the heart panel with icon + draining timer bar. New SFX: power-up chime and bubble pop. Effects clear on respawn; field capsules persist. 18 new unit tests (roll table, capsule lifecycle, magnet pull/expiry, double-jump state machine, bubble absorption); headless E2E verified all three effects plus the full stomp-drop-to-pickup chain, zero page errors.
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.
What
Stomped enemies now drop a glowing capsule on a 25% roll, introducing three timed power-ups:
Capsules bob and glow in the world, blink during their final 2 seconds, and evaporate with a particle poof after 10 s. Active effects render as HUD chips under the heart panel (icon + draining timer bar). New SFX: rising power-up chime and bubble pop. Effects clear on respawn; capsules left in the field persist until expiry.
Implementation
src/powerup.ts(new) — drop table (rollDrop, single injectable rng draw decides drop + type uniformly), capsule entity, shared icon renderersrc/player.ts— magnet/double-jump/bubble state, air double-jump branch, magnet in the crystal loop, capsule pickup, bubble absorb indamage()(after god-mode check), stomp drop hooksrc/level.ts— capsule array, spawn, update (collect/expiry), resetsrc/config.ts—CFG.poweruptuning blocksrc/audio.ts—powerup+bubblePopSFXsrc/game.ts— world render + HUD chipsValidation (local gate — CI is failing for pre-existing unrelated reasons)
npm run typecheck✓npm test— 193 passed (175 baseline + 18 new) ✓npm run build✓ (128.96 kB / 39.66 kB gzip, single file)npm run lint✓airJumpswith correct impulse; bubble absorbs a hit (hearts 3→3,invulnTset); forced stomp drop → capsule → same-frame pickup → fresh magnet timer (stomps: 1); field capsule screenshot. Zero page errors.Screenshots:
/tmp/tinyrex-e2e/01-hud-chips.png…06-capsule-field.png