Skip to content

Commit

Permalink
improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
cheryllium committed Jan 6, 2024
1 parent ecb6292 commit 651ee6a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -61,28 +63,28 @@ function preload() {
);
}

document.querySelector('#loading').innerText = 'Loading... 35%';
loading.innerText = 'Loading... 35%';

// Load emote images
speechBubbleImage = loadImage("assets/speech-bubble-blank.png");
for(let key of Object.keys(emoteImages)) {
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() {
Expand Down

0 comments on commit 651ee6a

Please sign in to comment.