diff options
author | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2024-12-24 17:58:20 +0100 |
---|---|---|
committer | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2024-12-24 17:58:20 +0100 |
commit | 25adfc618e77db9a5ee3b98ce0dab0be832efed0 (patch) | |
tree | 36ca56758ddd4674ab5a43df4b76bbfcc5a47af1 /preloader.js | |
parent | a840990bdcabf45fb0d377478ba0ab27222434ae (diff) |
hello kitty base done
Diffstat (limited to 'preloader.js')
-rw-r--r-- | preloader.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/preloader.js b/preloader.js new file mode 100644 index 0000000..214421e --- /dev/null +++ b/preloader.js @@ -0,0 +1,20 @@ +import * as ASSETS from "./src/assets.js" + +function preload(a) { + var tempImg = new Image() + tempImg.src=a +} + +function preloadAudio(a) { + var tempAud = new Audio(a) + tempAud.load() +} + +export function preloadAll() { +ASSETS.PORTAL.map(preload) +Array.from([ASSETS.BOSHY.BULLET, ASSETS.BOSHY.NORMAL]).map(preload) +Array.from([ASSETS.MUSIC.PREQUEL, ASSETS.MUSIC.HELL, ASSETS.MUSIC.DEATH]).map(preloadAudio) +Array.from([ASSETS.BACKGROUND.DEFAULT, ASSETS.BACKGROUND.DARK_SUN]).map(preload) +} + +preloadAll() |