MCPcopy Create free account
hub / github.com/YGYOOO/WorldX / parseCollisionLayer

Method parseCollisionLayer

client/src/systems/MapManager.ts:80–90  ·  view source on GitHub ↗
(layer: any)

Source from the content-addressed store, hash-verified

78 }
79
80 private parseCollisionLayer(layer: any): void {
81 const data: number[] = layer.data;
82 this.collisionGrid = [];
83 for (let y = 0; y < this.gridHeight; y++) {
84 const row: number[] = [];
85 for (let x = 0; x < this.gridWidth; x++) {
86 row.push(data[y * this.gridWidth + x] === 0 ? 0 : 1);
87 }
88 this.collisionGrid.push(row);
89 }
90 }
91
92 private parseLocationsLayer(layer: any): void {
93 for (const obj of layer.objects) {

Callers 1

loadFromTiledJSONMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected