Skip to content

Commit 2adb915

Browse files
elliptic1claude
andcommitted
Fix player falling off screen - add vertical wrap
Player now wraps from bottom to top of screen like classic Bubble Bobble. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9ca5f82 commit 2adb915

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

docs/game.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,14 @@ class Player {
130130
}
131131
}
132132

133-
// Screen wrap (horizontal)
133+
// Screen wrap
134134
if (this.x < -this.width) this.x = GAME_WIDTH;
135135
if (this.x > GAME_WIDTH) this.x = -this.width;
136+
// Vertical wrap - fall off bottom, appear at top
137+
if (this.y > GAME_HEIGHT) {
138+
this.y = -this.height;
139+
this.vy = 0;
140+
}
136141

137142
// Animation
138143
this.animTimer++;

0 commit comments

Comments
 (0)