mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 12:17:22 +00:00
Hide birb on fullscreen sites
This commit is contained in:
7
birb.js
7
birb.js
@@ -994,6 +994,13 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
||||
|
||||
function update() {
|
||||
ticks++;
|
||||
|
||||
// Hide bird if the browser is fullscreen
|
||||
if (document.fullscreenElement) {
|
||||
hideBirb();
|
||||
// Won't be restored on fullscreen exit
|
||||
}
|
||||
|
||||
if (currentState === States.IDLE) {
|
||||
if (Math.random() < 1 / (60 * 3) && currentAnimation !== Animations.HEART && !isMenuOpen()) {
|
||||
hop();
|
||||
|
||||
Reference in New Issue
Block a user