Ensure bird doesn't fly up too far

This commit is contained in:
Idrees Hassan committed 2025-10-29 19:17:05 -04:00
1 parent ea1f08c80d
commit 92dfea998f
5 files changed
+23 -5

No files matched your search

+6
View File
@@ -552,6 +552,12 @@ Promise.all([
birb.setAnimation(Animations.STILL);
}
// Clamp startY, birdY, targetY to a bit above the top of the window
const maxY = getWindowHeight() * 1.5;
startY = Math.min(startY, maxY);
birdY = Math.min(birdY, maxY);
targetY = Math.min(targetY, maxY);
// Update HTML element position
birb.setX(birdX);
birb.setY(birdY);