mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-26 04:07:24 +00:00
Align bird with hopped upon elements
This commit is contained in:
4
birb.js
4
birb.js
@@ -1029,7 +1029,7 @@ Promise.all([loadSpritesheetPixels(SPRITE_SHEET_URI), loadSpritesheetPixels(DECO
|
|||||||
petStack.shift();
|
petStack.shift();
|
||||||
}
|
}
|
||||||
const pets = petStack.filter((time) => Date.now() - time < 1000).length;
|
const pets = petStack.filter((time) => Date.now() - time < 1000).length;
|
||||||
if (pets >= 4) {
|
if (pets >= 3) {
|
||||||
setAnimation(Animations.HEART);
|
setAnimation(Animations.HEART);
|
||||||
// Clear the stack
|
// Clear the stack
|
||||||
petStack = [];
|
petStack = [];
|
||||||
@@ -1074,7 +1074,7 @@ Promise.all([loadSpritesheetPixels(SPRITE_SHEET_URI), loadSpritesheetPixels(DECO
|
|||||||
// Update the bird's position
|
// Update the bird's position
|
||||||
if (currentState === States.IDLE) {
|
if (currentState === States.IDLE) {
|
||||||
if (focusedElement !== null) {
|
if (focusedElement !== null) {
|
||||||
birdY = getFocusedElementY();
|
birdY = getFocusedElementY() - 0.5;
|
||||||
if (!isWithinHorizontalBounds()) {
|
if (!isWithinHorizontalBounds()) {
|
||||||
focusOnGround();
|
focusOnGround();
|
||||||
}
|
}
|
||||||
|
|||||||
4
dist/birb.js
vendored
4
dist/birb.js
vendored
@@ -1029,7 +1029,7 @@ Promise.all([loadSpritesheetPixels(SPRITE_SHEET_URI), loadSpritesheetPixels(DECO
|
|||||||
petStack.shift();
|
petStack.shift();
|
||||||
}
|
}
|
||||||
const pets = petStack.filter((time) => Date.now() - time < 1000).length;
|
const pets = petStack.filter((time) => Date.now() - time < 1000).length;
|
||||||
if (pets >= 4) {
|
if (pets >= 3) {
|
||||||
setAnimation(Animations.HEART);
|
setAnimation(Animations.HEART);
|
||||||
// Clear the stack
|
// Clear the stack
|
||||||
petStack = [];
|
petStack = [];
|
||||||
@@ -1074,7 +1074,7 @@ Promise.all([loadSpritesheetPixels(SPRITE_SHEET_URI), loadSpritesheetPixels(DECO
|
|||||||
// Update the bird's position
|
// Update the bird's position
|
||||||
if (currentState === States.IDLE) {
|
if (currentState === States.IDLE) {
|
||||||
if (focusedElement !== null) {
|
if (focusedElement !== null) {
|
||||||
birdY = getFocusedElementY();
|
birdY = getFocusedElementY() - 0.5;
|
||||||
if (!isWithinHorizontalBounds()) {
|
if (!isWithinHorizontalBounds()) {
|
||||||
focusOnGround();
|
focusOnGround();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user