diff --git a/src/managers/EffectsManager.js b/src/managers/EffectsManager.js index d1d01b7..0e129b1 100644 --- a/src/managers/EffectsManager.js +++ b/src/managers/EffectsManager.js @@ -21,7 +21,7 @@ export class EffectsManager { else this._spawnWind(player); this.speedLineTimer += delta; - if (this.speedLineTimer > 40) { + if (this.speedLineTimer > 65) { this.speedLineTimer = 0; this._spawnSpeedLine(); } @@ -70,7 +70,7 @@ export class EffectsManager { _spawnFlame(player) { const baseY = player.y + player.displayHeight / 2 - 6; - const count = 3; + const count = 2; for (let i = 0; i < count; i++) { const jitter = Phaser.Math.Between(-9, 9); const color = Phaser.Utils.Array.GetRandom(FLAME_COLORS); diff --git a/src/scenes/GameScene.js b/src/scenes/GameScene.js index b1de7aa..9b28adc 100644 --- a/src/scenes/GameScene.js +++ b/src/scenes/GameScene.js @@ -60,7 +60,10 @@ export class GameScene extends Scene { this.physics.add.overlap(this.player, this.platformManager.getEnemies(), this.handleEnemy, null, this); this.cameras.main.setBounds(0, -999999, GAME_WIDTH, 999999 + GAME_HEIGHT); - this.cameras.main.startFollow(this.player, true, 0, 0.05, 0, 180); + // Manual upward-only follow: camera rises with player but never drops. + // Avoids lerp lag at high boost velocities that looked like FPS judder. + this.cameraOffsetY = 180; + this.cameras.main.setRoundPixels(false); this.isGameOver = false; this.isPaused = false; @@ -83,7 +86,13 @@ export class GameScene extends Scene { this.player.update(this.cursors, this.wasd, this.touchLeft, this.touchRight, time, delta); - this.bg.tilePositionY = this.cameras.main.scrollY * 0.3; + // Camera follow: instantly track player on the way up, never drop. + const targetY = this.player.y - GAME_HEIGHT / 2 + this.cameraOffsetY; + if (targetY < this.cameras.main.scrollY) { + this.cameras.main.scrollY = targetY; + } + + this.bg.tilePositionY = Math.round(this.cameras.main.scrollY * 0.3); this.minScrollY = Math.min(this.minScrollY, this.cameras.main.scrollY); const killLine = this.minScrollY + GAME_HEIGHT;