feat: trees

This commit is contained in:
Dan Finch 2026-08-04 13:53:59 +02:00
parent 61389f091c
commit 9aa0ec6a3f
10 changed files with 311 additions and 10 deletions

View file

@ -1,13 +1,19 @@
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 grassUrl from "../assets/grass.png"
import leafUrl from "../assets/leaf.png"
import needleUrl from "../assets/needle.png"
import npcUrl from "../assets/npc.png"
import wallUrl from "../assets/wall.png"
export type Textures = {
floor: Texture
grass: Texture
bark: Texture
leaf: Texture
needle: Texture
wall: Texture
crate: Texture
npc: Texture
@ -15,14 +21,17 @@ export type Textures = {
/** Load every game texture up front. Call once before starting the loop. */
export async function loadTextures(): Promise<Textures> {
const [floor, grass, wall, crate, npc] = await Promise.all([
const [floor, grass, bark, leaf, needle, wall, crate, npc] = await Promise.all([
loadTexture(floorUrl),
loadTexture(grassUrl),
loadTexture(barkUrl),
loadTexture(leafUrl),
loadTexture(needleUrl),
loadTexture(wallUrl),
loadTexture(crateUrl),
loadTexture(npcUrl),
])
return { floor, grass, wall, crate, npc }
return { floor, grass, bark, leaf, needle, wall, crate, npc }
}
function loadTexture(url: string): Promise<Texture> {