Files
naddie-jump/src/main.js
AnRil d3f880d917 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
2026-05-23 16:51:51 +07:00

31 lines
784 B
JavaScript

import { Game, AUTO, Scale } from 'phaser';
import { BootScene } from './scenes/BootScene.js';
import { MenuScene } from './scenes/MenuScene.js';
import { GameScene } from './scenes/GameScene.js';
import { GameOverScene } from './scenes/GameOverScene.js';
import { GAME_WIDTH, GAME_HEIGHT, GRAVITY } from './config/game.config.js';
const config = {
type: AUTO,
parent: 'game-container',
width: GAME_WIDTH,
height: GAME_HEIGHT,
backgroundColor: '#0d001a',
scale: {
mode: Scale.FIT,
autoCenter: Scale.CENTER_BOTH,
},
physics: {
default: 'arcade',
arcade: {
gravity: { y: GRAVITY },
debug: false,
},
},
scene: [BootScene, MenuScene, GameScene, GameOverScene],
pixelArt: false,
antialias: true,
};
window.game = new Game(config);