import data from '../../../public/assets/dev/town.json'; export default async function createTown() { const area = {x: 60, y: 60}; const entities = []; entities.push({ AreaSize: {x: area.x * 16, y: area.y * 16}, Ticking: {}, TileLayers: { layers: [ { area, data, source: '/assets/tileset.json', tileSize: {x: 16, y: 16}, }, { area, data: Array(area.x * area.y).fill(0), source: '/assets/tileset.json', tileSize: {x: 16, y: 16}, }, ], }, Time: {}, Water: {water: {}}, }); entities.push({ Collider: { bodies: [ { points: [ {x: -8, y: -16}, {x: 7, y: -16}, {x: 7, y: 15}, {x: -8, y: 15}, ], }, ], collisionStartScript: ` if (other.Player) { ecs.switchEcs( other, ['homesteads', other.Player.id].join('/'), { Position: { x: 20, y: 438, }, }, ); } `, }, Position: {x: 952, y: 480}, Ticking: {}, }); return entities; }