Boost effects rewrite — flame, wind, speed lines, burst, puff
- EffectsManager handles all powerup visual feedback in one place - Replace circle trail with proper effects per type: * Rocket: yellow->red flame particles from feet + occasional bright spark * Propeller: white/blue wind streaks around player * Spring: gold/green spark trail while ascending fast - Boost start burst: two expanding rings + radial sparks + camera shake (orange/gold for rocket, cyan for propeller, green/gold for spring) - Boost end puff: gray smoke cloud spreading from player - Screen edge speed lines during boost (alternate left/right edges) - Player no longer tilts with horizontal input during boost; rocket stays rigid upright with tiny lean, propeller has gentle sinusoidal wobble
This commit is contained in:
@@ -34,24 +34,33 @@ export class Player extends Physics.Arcade.Sprite {
|
||||
if (this.x < -this.width / 2) this.x = GAME_WIDTH + this.width / 2;
|
||||
if (this.x > GAME_WIDTH + this.width / 2) this.x = -this.width / 2;
|
||||
|
||||
if (velocityX < 0) {
|
||||
this.setFlipX(true);
|
||||
this.setAngle(-5);
|
||||
} else if (velocityX > 0) {
|
||||
this.setFlipX(false);
|
||||
this.setAngle(5);
|
||||
} else {
|
||||
this.setAngle(0);
|
||||
}
|
||||
|
||||
if (this.state === 'propeller') {
|
||||
this.propellerTimer -= delta;
|
||||
this.setVelocityY(PROPELLER_VELOCITY);
|
||||
if (this.propellerTimer <= 0) this.endPowerUp();
|
||||
} else if (this.state === 'rocket') {
|
||||
if (this.state === 'rocket') {
|
||||
this.rocketTimer -= delta;
|
||||
this.setVelocityY(ROCKET_VELOCITY);
|
||||
if (velocityX < 0) this.setFlipX(true);
|
||||
else if (velocityX > 0) this.setFlipX(false);
|
||||
// Rocket: rigid upright with tiny lean toward movement
|
||||
this.setAngle(velocityX === 0 ? 0 : (velocityX < 0 ? -3 : 3));
|
||||
if (this.rocketTimer <= 0) this.endPowerUp();
|
||||
} else if (this.state === 'propeller') {
|
||||
this.propellerTimer -= delta;
|
||||
this.setVelocityY(PROPELLER_VELOCITY);
|
||||
if (velocityX < 0) this.setFlipX(true);
|
||||
else if (velocityX > 0) this.setFlipX(false);
|
||||
// Propeller: gentle sinusoidal wobble
|
||||
const wobble = Math.sin(time / 80) * 4;
|
||||
this.setAngle(wobble + (velocityX < 0 ? -2 : velocityX > 0 ? 2 : 0));
|
||||
if (this.propellerTimer <= 0) this.endPowerUp();
|
||||
} else {
|
||||
if (velocityX < 0) {
|
||||
this.setFlipX(true);
|
||||
this.setAngle(-5);
|
||||
} else if (velocityX > 0) {
|
||||
this.setFlipX(false);
|
||||
this.setAngle(5);
|
||||
} else {
|
||||
this.setAngle(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user