From 1062b2855a602f201507aaea47711afb30528dd3 Mon Sep 17 00:00:00 2001 From: AnRil Date: Sat, 23 May 2026 20:43:49 +0700 Subject: [PATCH] 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). --- .gitignore | 3 +++ src/scenes/GameScene.js | 26 +++++++------------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 0bc0fb8..0cdeeb3 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ rocket_preview.png # Agent notes — local only, useful for AI sessions but not for public repo AGENTS.md + +# Vercel CLI auth cache (workaround for Windows EXDEV issue) +.vercel-cli-config/ diff --git a/src/scenes/GameScene.js b/src/scenes/GameScene.js index 9b28adc..87883df 100644 --- a/src/scenes/GameScene.js +++ b/src/scenes/GameScene.js @@ -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;