Doodle-jump camera and remove player shadow

- Camera now uses a trigger line at 42% from top. Player rises/falls
  freely below the line; camera only scrolls up past it, never down.
- Remove playerShadow graphics that followed the hero around.
- Ignore .vercel-cli-config (CLI auth cache used as Windows workaround).
This commit is contained in:
2026-05-23 20:43:49 +07:00
parent 07b670fb09
commit 1062b2855a
2 changed files with 10 additions and 19 deletions

View File

@@ -41,9 +41,6 @@ export class GameScene extends Scene {
this.player = new Player(this, GAME_WIDTH / 2, startY - 140);
this.lastJumpY = this.player.y;
this.playerShadow = this.add.graphics();
this.playerShadow.setDepth(-4);
this.effects = new EffectsManager(this);
this.platformManager = new PlatformManager(this);
@@ -60,9 +57,9 @@ 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);
// 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;
// Doodle-jump camera: free movement below the trigger line, camera only
// scrolls up when player rises above it, and never moves down.
this.cameraTriggerY = GAME_HEIGHT * 0.42; // ~358 of 854 (just above middle)
this.cameras.main.setRoundPixels(false);
this.isGameOver = false;
@@ -86,10 +83,10 @@ export class GameScene extends Scene {
this.player.update(this.cursors, this.wasd, this.touchLeft, this.touchRight, time, delta);
// 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;
// Camera: latch player at trigger line going up, free movement otherwise.
const targetScrollY = this.player.y - this.cameraTriggerY;
if (targetScrollY < this.cameras.main.scrollY) {
this.cameras.main.scrollY = targetScrollY;
}
this.bg.tilePositionY = Math.round(this.cameras.main.scrollY * 0.3);
@@ -116,18 +113,9 @@ export class GameScene extends Scene {
this.lastJumpY = this.player.y;
}
this.updatePlayerShadow();
this.effects.update(this.player, delta);
}
updatePlayerShadow() {
this.playerShadow.clear();
if (!this.player.active) return;
const alpha = Math.max(0.05, 0.25 - (Math.abs(this.player.body.velocity.y) / 1200));
this.playerShadow.fillStyle(0x000000, alpha);
this.playerShadow.fillCircle(this.player.x, this.player.y + 42, 16);
}
platformCollisionFilter(player, platform) {
if (!platform || !platform.body) return false;
if (typeof platform.isBroken === 'function' && platform.isBroken()) return false;