feat: foilage
This commit is contained in:
parent
67cd54fe33
commit
6fb46573da
9 changed files with 270 additions and 19 deletions
|
|
@ -2,6 +2,7 @@ import type { Texture } from "../engine/render/Texture"
|
|||
import barkUrl from "../assets/bark.png"
|
||||
import crateUrl from "../assets/crate.png"
|
||||
import floorUrl from "../assets/floor.png"
|
||||
import flowerUrl from "../assets/flower.png"
|
||||
import grassUrl from "../assets/grass.png"
|
||||
import leafUrl from "../assets/leaf.png"
|
||||
import needleUrl from "../assets/needle.png"
|
||||
|
|
@ -16,6 +17,7 @@ export type Textures = {
|
|||
leaf: Texture
|
||||
needle: Texture
|
||||
rock: Texture
|
||||
flower: Texture
|
||||
wall: Texture
|
||||
crate: Texture
|
||||
npc: Texture
|
||||
|
|
@ -23,18 +25,19 @@ export type Textures = {
|
|||
|
||||
/** 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, wall, crate, npc] = await Promise.all([
|
||||
const [floor, grass, bark, leaf, needle, rock, flower, wall, crate, npc] = await Promise.all([
|
||||
loadTexture(floorUrl),
|
||||
loadTexture(grassUrl),
|
||||
loadTexture(barkUrl),
|
||||
loadTexture(leafUrl),
|
||||
loadTexture(needleUrl),
|
||||
loadTexture(rockUrl),
|
||||
loadTexture(flowerUrl),
|
||||
loadTexture(wallUrl),
|
||||
loadTexture(crateUrl),
|
||||
loadTexture(npcUrl),
|
||||
])
|
||||
return { floor, grass, bark, leaf, needle, rock, wall, crate, npc }
|
||||
return { floor, grass, bark, leaf, needle, rock, flower, wall, crate, npc }
|
||||
}
|
||||
|
||||
function loadTexture(url: string): Promise<Texture> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue