diff --git a/src/main.js b/src/main.js index de8577b..d331dec 100644 --- a/src/main.js +++ b/src/main.js @@ -46,10 +46,12 @@ window.bgMusic = null; window.journalOpen = false; function preload() { + let loading = document.querySelector('#loading'); + // Load background image bg = loadImage('assets/background.png'); - document.querySelector('#loading').innerText = 'Loading... 10%'; + loading.innerText = 'Loading... 10%'; // Load fish images for(let i=1; i<=NUM_TYPES_FISH; i++) { @@ -61,7 +63,7 @@ function preload() { ); } - document.querySelector('#loading').innerText = 'Loading... 35%'; + loading.innerText = 'Loading... 35%'; // Load emote images speechBubbleImage = loadImage("assets/speech-bubble-blank.png"); @@ -69,20 +71,20 @@ function preload() { emoteImages[key] = loadImage(`assets/emotes/${key}.png`) } - document.querySelector('#loading').innerText = 'Loading... 50%'; + loading.innerText = 'Loading... 50%'; // Load food images for(let key of Object.keys(foodImages)) { foodImages[key] = loadImage(`assets/food/${key}.png`); } - document.querySelector('#loading').innerText = 'Loading... 75%'; + loading.innerText = 'Loading... 75%'; // Load audio file soundFormats('mp3'); bgMusic = loadSound('assets/audio/soft_currents.mp3'); - document.querySelector('#loading').innerText = 'Loading... 99%'; + loading.innerText = 'Loading... 99%'; } function setup() {