1
0
forked from noxious/client

i dont even remember, something, something, zone editor

This commit is contained in:
2024-06-13 20:28:34 +02:00
parent 12445db7f1
commit 4bc076d55d
17 changed files with 479 additions and 207 deletions

View File

@ -23,3 +23,15 @@ export function tileToWorldXY(layer: Phaser.Tilemaps.TilemapLayer, pos_x: number
return { position_x, position_y }
}
export function generateTilemap(scene: Phaser.Scene, width: number, height: number, ) {
const zoneData = new Phaser.Tilemaps.MapData({
width: width, // @TODO : get this from the server
height: height, // @TODO : get this from the server
tileWidth: config.tile_size.x,
tileHeight: config.tile_size.y,
orientation: Phaser.Tilemaps.Orientation.ISOMETRIC,
format: Phaser.Tilemaps.Formats.ARRAY_2D
})
return new Phaser.Tilemaps.Tilemap(scene, zoneData);
}