WIP zone loading

This commit is contained in:
2024-12-29 00:40:02 +01:00
parent 8c664d7774
commit e4186a1bf5
3 changed files with 10 additions and 33 deletions

View File

@ -84,9 +84,9 @@ export function FlattenZoneArray(tiles: string[][]) {
return normalArray
}
export async function loadZoneTilesIntoScene(zone: ZoneT, scene: Phaser.Scene) {
export async function loadZoneTilesIntoScene(zone_id: number, scene: Phaser.Scene) {
// Fetch the list of tiles from the server
const tileArray: HttpResponse<AssetDataT[]> = await fetch(config.server_endpoint + '/assets/list_tiles/' + zone.id).then((response) => response.json())
const tileArray: HttpResponse<AssetDataT[]> = await fetch(config.server_endpoint + '/assets/list_tiles/' + zone_id).then((response) => response.json())
// Load each tile into the scene
for (const tile of tileArray.data ?? []) {