diff --git a/src/GameState/Factories/TilemapFactory.ts b/src/GameState/Factories/TilemapFactory.ts index 7c8afd6..ea8a764 100644 --- a/src/GameState/Factories/TilemapFactory.ts +++ b/src/GameState/Factories/TilemapFactory.ts @@ -33,7 +33,7 @@ export default class TilemapFactory { tilemap.forEachTile((tileIndex: number, i: number) => { if(tileIndex !== 0){ let x = (i % worldSize.x) * tileSize.x * 4; - let y = Math.floor(i / worldSize.y) * tileSize.y * 4; + let y = Math.floor(i / worldSize.x) * tileSize.y * 4; this.scene.physics.add(StaticBody, new Vec2(x, y), new Vec2(tileSize.x * 4, tileSize.y * 4)); } }); diff --git a/src/main.ts b/src/main.ts index 274caf8..0a47ffc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -78,7 +78,7 @@ function main(){ pauseMenu.disable(); } - mainScene.tilemap.add(OrthogonalTilemap, "assets/tilemaps/SmallTest.json"); + mainScene.tilemap.add(OrthogonalTilemap, "assets/tilemaps/Platformer.json"); for(let i = 0; i < 30; i++){ let cc = foregroundLayer.canvasNode.add(ColoredCircle); diff --git a/tsconfig.json b/tsconfig.json index bc19cdc..ca76d56 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,8 +3,8 @@ "src/main.ts", "src/Player.ts", - "src/DataTypes/Tilesets/TiledData", - "src/DataTypes/Tilesets/Tileset", + "src/DataTypes/Tilesets/TiledData.ts", + "src/DataTypes/Tilesets/Tileset.ts", "src/DataTypes/Collection.ts", "src/DataTypes/Map.ts", "src/DataTypes/Queue.ts",