blob: 5c9cbae2b0fae0237bc19ecd4d2d9377169525f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
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() {
Array.from([ASSETS.BOSHY.BULLET, ASSETS.BOSHY.NORMAL, ASSETS.BOSHY.BLOOD]).map(preload)
Object.keys(ASSETS.BOSHY.SOUNDS).map(key => preloadAudio(ASSETS.BOSHY.SOUNDS[key]))
Object.keys(ASSETS.MUSIC).map(key => preloadAudio(ASSETS.MUSIC[key]))
ASSETS.PORTAL.map(preload)
ASSETS.HELLO_KITTY.MAIN.map(preload)
ASSETS.HELLO_KITTY.SMALL.map(preload)
preload(ASSETS.HELLO_KITTY.BULLET)
Object.keys(ASSETS.HELLO_KITTY.SOUNDS).map(key => preloadAudio(ASSETS.HELLO_KITTY.SOUNDS[key]))
preload(ASSETS.WHITE)
preload(ASSETS.GAME_OVER)
preload(ASSETS.ANTICHEESE)
preload(ASSETS.BACKGROUND.KITTY)
}
preloadAll()
|