feat: bees and frogs
This commit is contained in:
parent
46e7070b6b
commit
16f205babe
13 changed files with 540 additions and 31 deletions
|
|
@ -1,8 +1,10 @@
|
|||
import type { Texture } from "../engine/render/Texture"
|
||||
import barkUrl from "../assets/bark.png"
|
||||
import beeUrl from "../assets/bee.png"
|
||||
import crateUrl from "../assets/crate.png"
|
||||
import floorUrl from "../assets/floor.png"
|
||||
import flowerUrl from "../assets/flower.png"
|
||||
import frogUrl from "../assets/frog.png"
|
||||
import grassUrl from "../assets/grass.png"
|
||||
import leafUrl from "../assets/leaf.png"
|
||||
import needleUrl from "../assets/needle.png"
|
||||
|
|
@ -21,11 +23,13 @@ export type Textures = {
|
|||
wall: Texture
|
||||
crate: Texture
|
||||
npc: Texture
|
||||
frog: Texture
|
||||
bee: Texture
|
||||
}
|
||||
|
||||
/** Load every game texture up front. Call once before starting the loop. */
|
||||
export async function loadTextures(): Promise<Textures> {
|
||||
const [floor, grass, bark, leaf, needle, rock, flower, wall, crate, npc] = await Promise.all([
|
||||
const [floor, grass, bark, leaf, needle, rock, flower, wall, crate, npc, frog, bee] = await Promise.all([
|
||||
loadTexture(floorUrl),
|
||||
loadTexture(grassUrl),
|
||||
loadTexture(barkUrl),
|
||||
|
|
@ -36,8 +40,10 @@ export async function loadTextures(): Promise<Textures> {
|
|||
loadTexture(wallUrl),
|
||||
loadTexture(crateUrl),
|
||||
loadTexture(npcUrl),
|
||||
loadTexture(frogUrl),
|
||||
loadTexture(beeUrl),
|
||||
])
|
||||
return { floor, grass, bark, leaf, needle, rock, flower, wall, crate, npc }
|
||||
return { floor, grass, bark, leaf, needle, rock, flower, wall, crate, npc, frog, bee }
|
||||
}
|
||||
|
||||
function loadTexture(url: string): Promise<Texture> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue