feat: game/engine split refactor + skybox
This commit is contained in:
parent
581e5892b0
commit
eeedcb8e48
34 changed files with 610 additions and 218 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import type { Texture } from "../engine/render/Texture"
|
||||
import type { Textures } from "../game/textures"
|
||||
import barkUrl from "../assets/bark.png"
|
||||
import beeUrl from "../assets/bee.png"
|
||||
import birchUrl from "../assets/birch.png"
|
||||
|
|
@ -12,28 +13,12 @@ import needleUrl from "../assets/needle.png"
|
|||
import npcUrl from "../assets/npc.png"
|
||||
import robinUrl from "../assets/robin.png"
|
||||
import rockUrl from "../assets/rock.png"
|
||||
import skyboxUrl from "../assets/rockies.skybox.png"
|
||||
import wallUrl from "../assets/wall.png"
|
||||
|
||||
export type Textures = {
|
||||
floor: Texture
|
||||
grass: Texture
|
||||
bark: Texture
|
||||
birch: Texture
|
||||
leaf: Texture
|
||||
needle: Texture
|
||||
rock: Texture
|
||||
flower: Texture
|
||||
wall: Texture
|
||||
crate: Texture
|
||||
npc: Texture
|
||||
frog: Texture
|
||||
bee: Texture
|
||||
robin: Texture
|
||||
}
|
||||
|
||||
/** Load every game texture up front. Call once before starting the loop. */
|
||||
export async function loadTextures(): Promise<Textures> {
|
||||
const [floor, grass, bark, birch, leaf, needle, rock, flower, wall, crate, npc, frog, bee, robin] = await Promise.all([
|
||||
const [floor, grass, bark, birch, leaf, needle, rock, flower, wall, crate, npc, frog, bee, robin, skybox] = await Promise.all([
|
||||
loadTexture(floorUrl),
|
||||
loadTexture(grassUrl),
|
||||
loadTexture(barkUrl),
|
||||
|
|
@ -48,8 +33,9 @@ export async function loadTextures(): Promise<Textures> {
|
|||
loadTexture(frogUrl),
|
||||
loadTexture(beeUrl),
|
||||
loadTexture(robinUrl),
|
||||
loadTexture(skyboxUrl),
|
||||
])
|
||||
return { floor, grass, bark, birch, leaf, needle, rock, flower, wall, crate, npc, frog, bee, robin }
|
||||
return { floor, grass, bark, birch, leaf, needle, rock, flower, wall, crate, npc, frog, bee, robin, skybox }
|
||||
}
|
||||
|
||||
function loadTexture(url: string): Promise<Texture> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue