summaryrefslogtreecommitdiff
path: root/preloader.js
blob: 214421e13e094f93b8d9dc3c3d6af0447d12c3e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()