Sprint 0: bug fixes and cleanup

- Fix Rocket/PropellerHat hitboxes (relative to sprite size, not magic offsets)
- Spring now destroys itself on use with squash animation instead of staying invisible
- Guard all powerups against double-trigger via consumed flag
- Save genesis glow tween reference for clean destroy
- Player.die() disables collisions (no more post-death platform bounces)
- Replace hardcoded enemy spawn cap 0.5 with DIFFICULTY.maxEnemyRate
- Enemy spawn position now anchored to platform X (-60/+60), not random
- Powerup spawn clamped to screen bounds
- Skip powerup spawn on breaking platforms (was unfair)
- ScoreManager.addPoints() public method; remove direct score mutation
- HUD elements use setScrollFactor(0) instead of per-frame repositioning
- All magic numbers extracted to SCORE / PHYSICS / POWERUP_DURATION config
- Remove dead code: showDeathVignette, drawDebug, createParticles, deathOverlay
- Remove dead constants: PLATFORM_WIDTH/HEIGHT, PLAYER_MAX_SPEED, tileBias
- Remove SUBMIT TO CHAIN fake button, replace with Coming Soon text
- Safer cleanup loop: collect-then-destroy instead of mutating during iterate
- gwei particles now have setScrollFactor(0.3) for parallax depth
This commit is contained in:
2026-05-23 16:51:51 +07:00
parent ea848c8923
commit d3f880d917
12 changed files with 175 additions and 249 deletions

View File

@@ -3,17 +3,14 @@ export const GAME_HEIGHT = 854;
export const GRAVITY = 1200;
export const JUMP_VELOCITY = -650;
export const SUPER_JUMP_VELOCITY = -950;
export const SUPER_JUMP_VELOCITY = -1050;
export const ROCKET_VELOCITY = -1400;
export const PROPELLER_VELOCITY = -950;
export const PLAYER_SPEED = 300;
export const PLAYER_MAX_SPEED = 400;
export const PLATFORM_GAP_MIN = 60;
export const PLATFORM_GAP_MAX = 120;
export const PLATFORM_WIDTH = 80;
export const PLATFORM_HEIGHT = 24;
export const SPAWN_RATES = {
stable: 0.60,
@@ -23,14 +20,12 @@ export const SPAWN_RATES = {
};
export const POWERUP_RATES = {
none: 0.91,
spring: 0.04,
propeller: 0.025,
rocket: 0.015,
rocket: 0.012,
};
export const ENEMY_RATES = {
none: 0.90,
bug: 0.10,
};
@@ -39,5 +34,28 @@ export const DIFFICULTY = {
gapIncreasePer1000: 12,
maxGap: 160,
enemyIncreasePer1000: 0.015,
maxEnemyRate: 0.25,
maxEnemyRate: 0.30,
};
export const SCORE = {
basePoints: 10,
genesisBonus: 50,
genesisJumps: 5,
genesisMultiplier: 2,
stompBonus: 25,
comboStep: 0.1,
comboMax: 3,
fallResetDistance: 300,
};
export const PHYSICS = {
stompTolerance: 12,
coyoteTime: 110,
jumpBufferTime: 130,
variableJumpCutoff: 0.45,
};
export const POWERUP_DURATION = {
propeller: 3500,
rocket: 3000,
};