From b7a9874dbca46234b587241e424c31f4f07d6f61 Mon Sep 17 00:00:00 2001 From: Jernej Habjan Date: Mon, 18 Dec 2023 17:02:32 +0100 Subject: [PATCH 001/138] Map rename --- .../{Map1.scene => MapRiverCrossing.scene} | 4 ++-- .../scenes/{Map1.ts => MapRiverCrossing.ts} | 4 ++-- .../game/scenes/PreloadProbableWaffle.ts | 22 +++++++++---------- .../game/world/const/game-config.ts | 16 +++++++------- .../asset-pack-probable-waffle.json | 4 ++-- .../{tiles.json => river_crossing.json} | 0 .../{tiles.tmx => river_crossing.tmx} | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) rename apps/client/src/app/probable-waffle/game/scenes/{Map1.scene => MapRiverCrossing.scene} (99%) rename apps/client/src/app/probable-waffle/game/scenes/{Map1.ts => MapRiverCrossing.ts} (99%) rename apps/client/src/assets/probable-waffle/tilemaps/{tiles.json => river_crossing.json} (100%) rename apps/client/src/metadata/probable-waffle/tilemaps/{tiles.tmx => river_crossing.tmx} (98%) diff --git a/apps/client/src/app/probable-waffle/game/scenes/Map1.scene b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene similarity index 99% rename from apps/client/src/app/probable-waffle/game/scenes/Map1.scene rename to apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene index 94dfbdd7..b5cc2511 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/Map1.scene +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene @@ -7,7 +7,7 @@ "autoImport": true, "preloadPackFiles": [], "createMethodName": "editorCreate", - "sceneKey": "Map1", + "sceneKey": "MapRiverCrossing", "compilerOutputLanguage": "TYPE_SCRIPT", "borderWidth": 1280, "borderHeight": 720 @@ -1160,4 +1160,4 @@ "contentType": "phasereditor2d.core.scene.SceneContentType", "version": 5 } -} \ No newline at end of file +} diff --git a/apps/client/src/app/probable-waffle/game/scenes/Map1.ts b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts similarity index 99% rename from apps/client/src/app/probable-waffle/game/scenes/Map1.ts rename to apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts index 4e1b28e6..2d45898a 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/Map1.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts @@ -58,9 +58,9 @@ import ActorContainer from "../entity/actor/ActorContainer"; import { AnimatedTilemap } from "./AnimatedTile"; /* END-USER-IMPORTS */ -export default class Map1 extends Phaser.Scene { +export default class MapRiverCrossing extends Phaser.Scene { constructor() { - super("Map1"); + super("MapRiverCrossing"); /* START-USER-CTR-CODE */ // Write your code here. diff --git a/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts b/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts index bbad3367..9a551a90 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts @@ -2,15 +2,15 @@ /* START OF COMPILED CODE */ -import Phaser from 'phaser'; -import PreloadBarUpdaterScript from '../../../other/Template/script-nodes/PreloadBarUpdaterScript'; +import Phaser from "phaser"; +import PreloadBarUpdaterScript from "../../../other/Template/script-nodes/PreloadBarUpdaterScript"; /* START-USER-IMPORTS */ -import assetPackUrl from '../../../../assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json'; +import assetPackUrl from "../../../../assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json"; /* END-USER-IMPORTS */ export default class PreloadProbableWaffle extends Phaser.Scene { constructor() { - super('PreloadProbableWaffle'); + super("PreloadProbableWaffle"); /* START-USER-CTR-CODE */ // Write your code here. @@ -19,7 +19,7 @@ export default class PreloadProbableWaffle extends Phaser.Scene { editorCreate(): void { // guapen - const guapen = this.add.image(505.0120544433594, 360, 'guapen'); + const guapen = this.add.image(505.0120544433594, 360, "guapen"); guapen.scaleX = 0.32715486817515643; guapen.scaleY = 0.32715486817515643; @@ -39,11 +39,11 @@ export default class PreloadProbableWaffle extends Phaser.Scene { progressBarBg.isStroked = true; // loadingText - const loadingText = this.add.text(552.0120849609375, 329, '', {}); - loadingText.text = 'Loading...'; - loadingText.setStyle({ color: '#e0e0e0', fontFamily: 'arial', fontSize: '20px' }); + const loadingText = this.add.text(552.0120849609375, 329, "", {}); + loadingText.text = "Loading..."; + loadingText.setStyle({ color: "#e0e0e0", fontFamily: "arial", fontSize: "20px" }); - this.events.emit('scene-awake'); + this.events.emit("scene-awake"); } /* START-USER-CODE */ @@ -53,11 +53,11 @@ export default class PreloadProbableWaffle extends Phaser.Scene { preload() { this.editorCreate(); - this.load.pack('asset-pack', assetPackUrl as any); + this.load.pack("asset-pack", assetPackUrl as any); } create() { - this.scene.start('Map1'); + this.scene.start("MapRiverCrossing"); } /* END-USER-CODE */ diff --git a/apps/client/src/app/probable-waffle/game/world/const/game-config.ts b/apps/client/src/app/probable-waffle/game/world/const/game-config.ts index 24891338..620fb089 100644 --- a/apps/client/src/app/probable-waffle/game/world/const/game-config.ts +++ b/apps/client/src/app/probable-waffle/game/world/const/game-config.ts @@ -1,16 +1,16 @@ -import { environment } from '../../../../../environments/environment'; -import { Types } from 'phaser'; -import { baseGameConfig } from '../../../../shared/game/base-game.config'; -import Map1 from "../../scenes/Map1"; +import { environment } from "../../../../../environments/environment"; +import { Types } from "phaser"; +import { baseGameConfig } from "../../../../shared/game/base-game.config"; +import MapRiverCrossing from "../../scenes/MapRiverCrossing"; import PreloadProbableWaffle from "../../scenes/PreloadProbableWaffle"; -import {Boot} from "../../scenes/Boot"; +import { Boot } from "../../scenes/Boot"; export const probableWaffleGameConfig: Types.Core.GameConfig = { ...baseGameConfig, // scene: [GrasslandScene, PlaygroundScene], - scene: [Boot, PreloadProbableWaffle, Map1], + scene: [Boot, PreloadProbableWaffle, MapRiverCrossing], physics: { - default: 'arcade', + default: "arcade", arcade: { fps: 60, gravity: { y: 0 }, @@ -18,5 +18,5 @@ export const probableWaffleGameConfig: Types.Core.GameConfig = { } }, pixelArt: true, - backgroundColor: '#222' + backgroundColor: "#222" }; diff --git a/apps/client/src/assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json b/apps/client/src/assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json index 8ca7538c..1fde73b3 100644 --- a/apps/client/src/assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json +++ b/apps/client/src/assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json @@ -313,8 +313,8 @@ "key": "slingshot_female_walk" }, { - "url": "assets/probable-waffle/tilemaps/tiles.json", - "path": "assets/probable-waffle/tilemaps/tiles.json", + "url": "assets/probable-waffle/tilemaps/river_crossing.json", + "path": "assets/probable-waffle/tilemaps/river_crossing.json", "type": "tilemapTiledJSON", "key": "tiles" }, diff --git a/apps/client/src/assets/probable-waffle/tilemaps/tiles.json b/apps/client/src/assets/probable-waffle/tilemaps/river_crossing.json similarity index 100% rename from apps/client/src/assets/probable-waffle/tilemaps/tiles.json rename to apps/client/src/assets/probable-waffle/tilemaps/river_crossing.json diff --git a/apps/client/src/metadata/probable-waffle/tilemaps/tiles.tmx b/apps/client/src/metadata/probable-waffle/tilemaps/river_crossing.tmx similarity index 98% rename from apps/client/src/metadata/probable-waffle/tilemaps/tiles.tmx rename to apps/client/src/metadata/probable-waffle/tilemaps/river_crossing.tmx index b80e644a..7a1209e3 100644 --- a/apps/client/src/metadata/probable-waffle/tilemaps/tiles.tmx +++ b/apps/client/src/metadata/probable-waffle/tilemaps/river_crossing.tmx @@ -1,7 +1,7 @@ - + From 554393ee97ad8b45eb2449985f78a12a5100dbc6 Mon Sep 17 00:00:00 2001 From: Jernej Habjan Date: Mon, 18 Dec 2023 17:04:06 +0100 Subject: [PATCH 002/138] Map adjustment --- .../game/scenes/MapRiverCrossing.scene | 217 ++---------------- .../game/scenes/MapRiverCrossing.ts | 92 +------- 2 files changed, 19 insertions(+), 290 deletions(-) diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene index b5cc2511..2853e0a0 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene @@ -644,8 +644,8 @@ "y" ], "label": "tree_2", - "x": -304, - "y": 1040 + "x": -912, + "y": 848 }, { "prefabId": "ec58b20e-e04f-4bd4-8401-856efe433f36", @@ -655,8 +655,8 @@ "y" ], "label": "tree1", - "x": -448, - "y": 1200 + "x": -1184, + "y": 832 }, { "prefabId": "ec58b20e-e04f-4bd4-8401-856e1e433f36", @@ -666,8 +666,8 @@ "y" ], "label": "tree_3", - "x": -256, - "y": 1168 + "x": -896, + "y": 1056 }, { "prefabId": "ec58b20e-e04f-4bd4-8401-851ffe433f31", @@ -677,8 +677,8 @@ "y" ], "label": "treeTrunk_1", - "x": -384, - "y": 1200 + "x": -784, + "y": 880 }, { "prefabId": "ec58b20e-e04f-4bd4-8401-856efe433f30", @@ -721,8 +721,8 @@ "y" ], "label": "bushDry_1", - "x": -368, - "y": 1136 + "x": -1072, + "y": 944 }, { "prefabId": "ec58b20e-e04f-4bd4-8401-856ffe433f26", @@ -787,8 +787,8 @@ "y" ], "label": "bushDry_4", - "x": -80, - "y": 1072 + "x": -1024, + "y": 768 }, { "prefabId": "ec58b20e-e04f-4bd4-8401-856efe433f30", @@ -812,197 +812,6 @@ "x": -592, "y": 512 }, - { - "prefabId": "ec58b20e-e04f-4bd4-140f-856ffe433f22", - "id": "6e604eff-f979-479b-9b0e-4d48adf80f33", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian2", - "x": -1248, - "y": 640 - }, - { - "prefabId": "ec58b20e-e03f-4bd4-140e-856ffe433f25", - "id": "59df8861-9ffd-4d29-b9de-b3bdd35b320b", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian1", - "x": -1280, - "y": 656 - }, - { - "prefabId": "ec58b20e-e03f-4bd4-140e-856ffe433f25", - "id": "56ef28c7-c5b8-4b5e-86de-9215cc845daa", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian", - "x": -1248, - "y": 672 - }, - { - "prefabId": "ec58b20e-e04f-4bd4-140f-856ffe433f22", - "id": "4082867b-97ca-413b-aac2-a974144bc4d6", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian_1", - "x": -1312, - "y": 672 - }, - { - "prefabId": "ec58b20e-e04f-4bd4-140f-856ffe433f22", - "id": "b15b7931-4294-4077-b20f-947ba8eac60b", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian_3", - "x": -1344, - "y": 688 - }, - { - "prefabId": "ec58b20e-e03f-4bd4-140e-856ffe433f25", - "id": "37143707-273a-4983-803f-1bc5e99d0447", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian_2", - "x": -1296, - "y": 704 - }, - { - "prefabId": "ec58b20e-e03f-4bd4-140e-856ffe433f25", - "id": "9950edac-796a-412d-b9bd-9e7d9cb9dfb9", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian_5", - "x": -1376, - "y": 704 - }, - { - "prefabId": "ec58b20e-e03f-4bd4-140e-856ffe433f25", - "id": "7e8b7c3b-3201-4488-af0f-f575ca7bb04f", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian_4", - "x": -1344, - "y": 720 - }, - { - "prefabId": "ec58b20e-e03e-4bd4-140e-156ffe433f29", - "id": "c2cb02f7-9aab-45d6-96b0-2a25aec4f327", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidianLava5", - "x": -1376, - "y": 736 - }, - { - "prefabId": "ec58b20e-e03e-4bd4-140e-156ffe433f27", - "id": "64f3d20d-eefb-4036-a698-92b58c89fca9", - "unlock": [ - "x", - "y", - "z" - ], - "label": "blockObsidianLava3", - "z": 32, - "x": -1408, - "y": 688 - }, - { - "prefabId": "ec58b20e-e03f-4bd4-140e-856ffe433f25", - "id": "df96bc37-9abb-496e-b8c2-c9911373ee2c", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian_7", - "x": -1440, - "y": 736 - }, - { - "prefabId": "ec58b20e-e03f-4bd4-140e-856ffe433f25", - "id": "37ede123-5a35-4fa5-8658-0e94d93976a0", - "unlock": [ - "x", - "y", - "z" - ], - "label": "blockObsidian_6", - "z": 32, - "x": -1440, - "y": 704 - }, - { - "prefabId": "ec58b20e-e03e-4bd4-140e-156ffe433f25", - "id": "22be42be-5e03-4d50-b7a0-3f5c5d5abea1", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidianLava1", - "x": -1408, - "y": 752 - }, - { - "prefabId": "ec58b20e-e03f-4bd4-140e-856ffe433f25", - "id": "fb8b68e6-93f7-4371-85ac-5616732a0a9f", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian_8", - "x": -1472, - "y": 752 - }, - { - "prefabId": "ec58b20e-e04f-4bd4-140f-856ffe433f22", - "id": "48ac226b-afd5-41d1-b63a-357393b0a232", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian_9", - "x": -1440, - "y": 768 - }, - { - "prefabId": "ec58b20e-e03e-4bd4-140e-156ffe433f26", - "id": "eed9763a-d9c1-4b02-a9bf-ab8b067baee3", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidianLava2", - "x": -1408, - "y": 784 - }, - { - "prefabId": "ec58b20e-e03f-4bd4-140e-856ffe433f25", - "id": "54fc667e-ee9c-4097-864a-7e551d3ae7be", - "unlock": [ - "x", - "y" - ], - "label": "blockObsidian_10", - "x": -1440, - "y": 800 - }, { "prefabId": "ec58b20e-e04f-4bd4-140e-856ffe433f21", "id": "7c34cacb-c700-4622-87d3-8663631f755d", @@ -1160,4 +969,4 @@ "contentType": "phasereditor2d.core.scene.SceneContentType", "version": 5 } -} +} \ No newline at end of file diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts index 2d45898a..f1863a27 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts @@ -44,12 +44,6 @@ import Tree1 from "../prefabs/outside/foliage/trees/resources/Tree1"; import BushDry from "../prefabs/outside/foliage/bushes/BushDry"; import BushUpwardsSmall from "../prefabs/outside/foliage/bushes/BushUpwardsSmall"; import WorkMill from "../prefabs/buildings/tivara/WorkMill"; -import BlockObsidian2 from "../prefabs/outside/nature/block_obsidian/BlockObsidian2"; -import BlockObsidian1 from "../prefabs/outside/nature/block_obsidian/BlockObsidian1"; -import BlockObsidianLava5 from "../prefabs/outside/nature/block_obsidian_lava/BlockObsidianLava5"; -import BlockObsidianLava3 from "../prefabs/outside/nature/block_obsidian_lava/BlockObsidianLava3"; -import BlockObsidianLava1 from "../prefabs/outside/nature/block_obsidian_lava/BlockObsidianLava1"; -import BlockObsidianLava2 from "../prefabs/outside/nature/block_obsidian_lava/BlockObsidianLava2"; import BlockStoneWater1 from "../prefabs/outside/nature/block_stone_water/BlockStoneWater1"; import BlockStoneWater4 from "../prefabs/outside/nature/block_stone_water/BlockStoneWater4"; import BlockStoneWater3 from "../prefabs/outside/nature/block_stone_water/BlockStoneWater3"; @@ -292,19 +286,19 @@ export default class MapRiverCrossing extends Phaser.Scene { this.add.existing(tree_1); // tree_2 - const tree_2 = new Tree4(this, -304, 1040); + const tree_2 = new Tree4(this, -912, 848); this.add.existing(tree_2); // tree1 - const tree1 = new Tree1(this, -448, 1200); + const tree1 = new Tree1(this, -1184, 832); this.add.existing(tree1); // tree_3 - const tree_3 = new Tree4(this, -256, 1168); + const tree_3 = new Tree4(this, -896, 1056); this.add.existing(tree_3); // treeTrunk_1 - const treeTrunk_1 = new TreeTrunk(this, -384, 1200); + const treeTrunk_1 = new TreeTrunk(this, -784, 880); this.add.existing(treeTrunk_1); // tree_4 @@ -320,7 +314,7 @@ export default class MapRiverCrossing extends Phaser.Scene { this.add.existing(bushDry); // bushDry_1 - const bushDry_1 = new BushDry(this, -368, 1136); + const bushDry_1 = new BushDry(this, -1072, 944); this.add.existing(bushDry_1); // bushDry_2 @@ -344,7 +338,7 @@ export default class MapRiverCrossing extends Phaser.Scene { this.add.existing(bushUpwardsSmall_1); // bushDry_4 - const bushDry_4 = new BushDry(this, -80, 1072); + const bushDry_4 = new BushDry(this, -1024, 768); this.add.existing(bushDry_4); // tree @@ -355,74 +349,6 @@ export default class MapRiverCrossing extends Phaser.Scene { const workMill = new WorkMill(this, -592, 512); this.add.existing(workMill); - // blockObsidian2 - const blockObsidian2 = new BlockObsidian2(this, -1248, 640); - this.add.existing(blockObsidian2); - - // blockObsidian1 - const blockObsidian1 = new BlockObsidian1(this, -1280, 656); - this.add.existing(blockObsidian1); - - // blockObsidian - const blockObsidian = new BlockObsidian1(this, -1248, 672); - this.add.existing(blockObsidian); - - // blockObsidian_1 - const blockObsidian_1 = new BlockObsidian2(this, -1312, 672); - this.add.existing(blockObsidian_1); - - // blockObsidian_3 - const blockObsidian_3 = new BlockObsidian2(this, -1344, 688); - this.add.existing(blockObsidian_3); - - // blockObsidian_2 - const blockObsidian_2 = new BlockObsidian1(this, -1296, 704); - this.add.existing(blockObsidian_2); - - // blockObsidian_5 - const blockObsidian_5 = new BlockObsidian1(this, -1376, 704); - this.add.existing(blockObsidian_5); - - // blockObsidian_4 - const blockObsidian_4 = new BlockObsidian1(this, -1344, 720); - this.add.existing(blockObsidian_4); - - // blockObsidianLava5 - const blockObsidianLava5 = new BlockObsidianLava5(this, -1376, 736); - this.add.existing(blockObsidianLava5); - - // blockObsidianLava3 - const blockObsidianLava3 = new BlockObsidianLava3(this, -1408, 688); - this.add.existing(blockObsidianLava3); - - // blockObsidian_7 - const blockObsidian_7 = new BlockObsidian1(this, -1440, 736); - this.add.existing(blockObsidian_7); - - // blockObsidian_6 - const blockObsidian_6 = new BlockObsidian1(this, -1440, 704); - this.add.existing(blockObsidian_6); - - // blockObsidianLava1 - const blockObsidianLava1 = new BlockObsidianLava1(this, -1408, 752); - this.add.existing(blockObsidianLava1); - - // blockObsidian_8 - const blockObsidian_8 = new BlockObsidian1(this, -1472, 752); - this.add.existing(blockObsidian_8); - - // blockObsidian_9 - const blockObsidian_9 = new BlockObsidian2(this, -1440, 768); - this.add.existing(blockObsidian_9); - - // blockObsidianLava2 - const blockObsidianLava2 = new BlockObsidianLava2(this, -1408, 784); - this.add.existing(blockObsidianLava2); - - // blockObsidian_10 - const blockObsidian_10 = new BlockObsidian1(this, -1440, 800); - this.add.existing(blockObsidian_10); - // blockStone_12 const blockStone_12 = new BlockStone1(this, 352, 976); this.add.existing(blockStone_12); @@ -498,12 +424,6 @@ export default class MapRiverCrossing extends Phaser.Scene { // tree4 (prefab fields) tree4.z = 160; - // blockObsidianLava3 (prefab fields) - blockObsidianLava3.z = 32; - - // blockObsidian_6 (prefab fields) - blockObsidian_6.z = 32; - // blockStoneWater1 (prefab fields) blockStoneWater1.z = 16; From 4395284f1b93f939bef88cee4f727625c7616513 Mon Sep 17 00:00:00 2001 From: Jernej Habjan Date: Mon, 18 Dec 2023 17:57:56 +0100 Subject: [PATCH 003/138] Ember enclave --- .../game/scenes/AnimatedTile.ts | 21 +- .../game/scenes/EmberEnclave.scene | 224 + .../game/scenes/EmberEnclave.ts | 124 + .../game/scenes/MapRiverCrossing.scene | 4 +- .../game/scenes/MapRiverCrossing.ts | 35 +- .../game/scenes/PreloadProbableWaffle.ts | 32 +- .../asset-pack-probable-waffle.json | 20 - ...et-pack-probable-waffle-ember-enclave.json | 33 + ...t-pack-probable-waffle-river-crossing.json | 33 + .../tilemaps/ember_enclave.json | 5815 +++++++++++++++++ .../tilemaps/ember_enclave.tmx | 62 + 11 files changed, 6359 insertions(+), 44 deletions(-) create mode 100644 apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.scene create mode 100644 apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.ts create mode 100644 apps/client/src/assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-ember-enclave.json create mode 100644 apps/client/src/assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-river-crossing.json create mode 100644 apps/client/src/assets/probable-waffle/tilemaps/ember_enclave.json create mode 100644 apps/client/src/metadata/probable-waffle/tilemaps/ember_enclave.tmx diff --git a/apps/client/src/app/probable-waffle/game/scenes/AnimatedTile.ts b/apps/client/src/app/probable-waffle/game/scenes/AnimatedTile.ts index 31d8a28e..7ca573b5 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/AnimatedTile.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/AnimatedTile.ts @@ -70,15 +70,19 @@ export class AnimatedTilemap { private readonly animatedTiles: AnimatedTile[]; constructor( + private readonly scene: Phaser.Scene, private readonly tilemap: Phaser.Tilemaps.Tilemap, - private readonly tileset: Phaser.Tilemaps.Tileset + private readonly tilesets: Phaser.Tilemaps.Tileset[] ) { this.animatedTiles = this.initAnimatedTiles(); + this.scene.events.on("update", this.update); + this.scene.events.on("shutdown", this.destroy); } - initAnimatedTiles = () => { + private initAnimatedTiles = () => { const animatedTiles: AnimatedTile[] = []; - const tileData = this.tileset.tileData as TilesetTileData; + const tileset = this.relevantTileset; + const tileData = tileset.tileData as TilesetTileData; for (const tileId in tileData) { this.tilemap.layers.forEach((layer) => { if (layer.tilemapLayer.type === "StaticTilemapLayer") return; @@ -86,9 +90,9 @@ export class AnimatedTilemap { tileRow.forEach((tile) => { // Typically `firstgid` is 1, which means tileId starts from 1. // TileId in Tiled starts from 0. - if (tile.index - this.tileset.firstgid === parseInt(tileId, 10)) { + if (tile.index - tileset.firstgid === parseInt(tileId, 10)) { if (!tileData[tileId].animation) return; - animatedTiles.push(new AnimatedTile(tile, tileData[tileId].animation!, this.tileset.firstgid)); + animatedTiles.push(new AnimatedTile(tile, tileData[tileId].animation!, tileset.firstgid)); } }) ); @@ -97,5 +101,10 @@ export class AnimatedTilemap { return animatedTiles; }; - update = (delta: number) => this.animatedTiles.forEach((tile) => tile.update(delta)); + private get relevantTileset() { + return this.tilesets[0]; + } + + private update = (delta: number) => this.animatedTiles.forEach((tile) => tile.update(delta)); + private destroy = () => this.scene.events.off("update", this.update); } diff --git a/apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.scene b/apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.scene new file mode 100644 index 00000000..fb78eac7 --- /dev/null +++ b/apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.scene @@ -0,0 +1,224 @@ +{ + "id": "83b754e4-4d45-480d-923c-5b7fccee4e93", + "sceneType": "SCENE", + "settings": { + "snapEnabled": true, + "exportClass": true, + "autoImport": true, + "preloadPackFiles": [], + "createMethodName": "editorCreate", + "sceneKey": "EmberEnclave", + "compilerOutputLanguage": "TYPE_SCRIPT", + "borderWidth": 1280, + "borderHeight": 720 + }, + "displayList": [ + { + "type": "TilemapLayer", + "id": "9cdf4f18-3323-43bf-b105-00fddbdbc7e6", + "label": "tilemap_level_1", + "x": -32, + "tilemapId": "9cb0db04-e78b-4290-b950-d943f1631f3b", + "layerName": "TileMap_level_1", + "tilesets": [ + "tiles" + ] + }, + { + "prefabId": "ec58b20e-e03e-4bd4-140e-156ffe433f29", + "id": "5f2a21e3-1bc1-4f9b-9aa8-f4f1c035ff36", + "unlock": [ + "x", + "y" + ], + "label": "blockObsidianLava5", + "x": -48, + "y": 432 + }, + { + "prefabId": "ec58b20e-e04f-4bd4-8401-856ffe433f24", + "id": "d79386cf-ba61-42d8-8c8d-715db1cd97d7", + "unlock": [ + "x", + "y" + ], + "label": "bushDownwardsLarge", + "x": 32, + "y": 688 + }, + { + "prefabId": "ec58b20e-e03e-4bd4-140e-156ffe433f28", + "id": "10ef234e-96c6-4bd3-baf1-e49ab7c41f7e", + "unlock": [ + "x", + "y" + ], + "label": "blockObsidianLava4", + "x": 192, + "y": 560 + }, + { + "prefabId": "ec58b20e-e04f-4bd4-8401-856e1e433f46", + "id": "a0dfb8e4-473a-46b0-85b6-d919fe2458f1", + "unlock": [ + "x", + "y" + ], + "label": "tree6", + "x": 0, + "y": 736 + }, + { + "prefabId": "ec58b20e-e04f-4bd4-8401-856ffe433f27", + "id": "6c476ea2-631f-498b-8af5-d31c99b66da0", + "unlock": [ + "x", + "y" + ], + "label": "bushUpwardsLarge", + "x": -48, + "y": 768 + }, + { + "prefabId": "ec58b20e-e04f-4bd4-8401-856ffe433f25", + "id": "d8349901-94f9-4008-8d8c-f8dc5d1f766b", + "unlock": [ + "x", + "y" + ], + "label": "bushDownwardsSmall", + "x": 48, + "y": 768 + }, + { + "prefabId": "ec58b20e-e03e-4bd4-140e-856ffe433f55", + "id": "16d280f1-366a-4065-8f04-61ef49129355", + "unlock": [ + "x", + "y" + ], + "label": "blockStoneWater4", + "x": 0, + "y": 816 + }, + { + "prefabId": "99a75a7c-60b5-4368-a9af-0f16ddb21bbc", + "id": "c65a1b78-d6b8-47e8-b765-9cc671e38a24", + "unlock": [ + "x", + "y" + ], + "label": "ankGuard", + "x": 688, + "y": 752 + }, + { + "prefabId": "562c6656-92bb-49f3-b9f3-cd63b0b72e68", + "id": "30204112-523e-4d1c-8953-5094f5d57fb8", + "unlock": [ + "x", + "y" + ], + "label": "sandhold", + "x": 496, + "y": 880 + }, + { + "prefabId": "562c6656-92bb-49f3-b9f3-cd63b0b72e68", + "id": "d62f8d92-119e-4967-9b17-818a760244be", + "unlock": [ + "x", + "y" + ], + "label": "sandhold_1", + "x": -816, + "y": 720 + }, + { + "prefabId": "b425696b-ec20-4f72-9aaf-a4f2aaf3e65b", + "id": "0ff3f098-08a2-4666-8763-c1afe79db6b5", + "unlock": [ + "x", + "y" + ], + "label": "temple", + "x": -607, + "y": 882 + }, + { + "prefabId": "6c2cf0db-4461-4b32-b5d3-9882c5326e1b", + "id": "64572dc8-4d91-4fc7-8377-8faf3badd56c", + "unlock": [ + "x", + "y" + ], + "label": "tivaraSlingshotFemale", + "x": 457, + "y": 1095 + }, + { + "prefabId": "004276d5-437a-44f5-b7ca-161086c4ad5e", + "id": "dc62e88e-34d7-4855-913d-3646dbc09c94", + "unlock": [ + "x", + "y" + ], + "label": "tivaraWorkerFemale", + "x": -880, + "y": 880 + }, + { + "prefabId": "edf32147-e546-4f6e-91ba-1720c6b75ac9", + "id": "a111638e-956b-4d8a-aa9a-23473ad399d6", + "unlock": [ + "x", + "y" + ], + "label": "tivaraWorkerMale", + "x": -592, + "y": 688 + }, + { + "prefabId": "ec58b20e-e04f-4bd3-840e-856ffe433f23", + "id": "f691c685-3bd9-4749-a260-d260f400e25f", + "unlock": [ + "x", + "y" + ], + "label": "workMill", + "x": -160, + "y": 736 + }, + { + "prefabId": "ec58b20e-e04f-4bd3-840e-856ffe433f23", + "id": "a870b52f-ae30-481a-a246-8f132deca998", + "unlock": [ + "x", + "y" + ], + "label": "workMill_1", + "x": 192, + "y": 704 + } + ], + "plainObjects": [ + { + "id": "9cb0db04-e78b-4290-b950-d943f1631f3b", + "type": "Tilemap", + "label": "tilemap", + "key": "tiles_ember_enclave", + "tilesets": [ + { + "name": "tiles", + "imageKey": "tiles_1" + } + ] + } + ], + "meta": { + "app": "Phaser Editor 2D - Scene Editor", + "url": "https://phasereditor2d.com", + "contentType": "phasereditor2d.core.scene.SceneContentType", + "version": 5 + } +} \ No newline at end of file diff --git a/apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.ts b/apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.ts new file mode 100644 index 00000000..6b46a140 --- /dev/null +++ b/apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.ts @@ -0,0 +1,124 @@ +// You can write more code here + +/* START OF COMPILED CODE */ + +import Phaser from "phaser"; +import BlockObsidianLava5 from "../prefabs/outside/nature/block_obsidian_lava/BlockObsidianLava5"; +import BushDownwardsLarge from "../prefabs/outside/foliage/bushes/BushDownwardsLarge"; +import BlockObsidianLava4 from "../prefabs/outside/nature/block_obsidian_lava/BlockObsidianLava4"; +import Tree6 from "../prefabs/outside/foliage/trees/resources/Tree6"; +import BushUpwardsLarge from "../prefabs/outside/foliage/bushes/BushUpwardsLarge"; +import BushDownwardsSmall from "../prefabs/outside/foliage/bushes/BushDownwardsSmall"; +import BlockStoneWater4 from "../prefabs/outside/nature/block_stone_water/BlockStoneWater4"; +import AnkGuard from "../prefabs/buildings/tivara/AnkGuard"; +import Sandhold from "../prefabs/buildings/tivara/Sandhold"; +import Temple from "../prefabs/buildings/tivara/Temple"; +import TivaraSlingshotFemale from "../prefabs/characters/tivara/TivaraSlingshotFemale"; +import TivaraWorkerFemale from "../prefabs/characters/tivara/TivaraWorkerFemale"; +import TivaraWorkerMale from "../prefabs/characters/tivara/TivaraWorkerMale"; +import WorkMill from "../prefabs/buildings/tivara/WorkMill"; +/* START-USER-IMPORTS */ +/* END-USER-IMPORTS */ + +export default class EmberEnclave extends Phaser.Scene { + constructor() { + super("EmberEnclave"); + + /* START-USER-CTR-CODE */ + // Write your code here. + /* END-USER-CTR-CODE */ + } + + editorCreate(): void { + // tilemap + const tilemap = this.add.tilemap("tiles_ember_enclave"); + tilemap.addTilesetImage("tiles", "tiles_1"); + + // tilemap_level_1 + tilemap.createLayer("TileMap_level_1", ["tiles"], -32, 0); + + // blockObsidianLava5 + const blockObsidianLava5 = new BlockObsidianLava5(this, -48, 432); + this.add.existing(blockObsidianLava5); + + // bushDownwardsLarge + const bushDownwardsLarge = new BushDownwardsLarge(this, 32, 688); + this.add.existing(bushDownwardsLarge); + + // blockObsidianLava4 + const blockObsidianLava4 = new BlockObsidianLava4(this, 192, 560); + this.add.existing(blockObsidianLava4); + + // tree6 + const tree6 = new Tree6(this, 0, 736); + this.add.existing(tree6); + + // bushUpwardsLarge + const bushUpwardsLarge = new BushUpwardsLarge(this, -48, 768); + this.add.existing(bushUpwardsLarge); + + // bushDownwardsSmall + const bushDownwardsSmall = new BushDownwardsSmall(this, 48, 768); + this.add.existing(bushDownwardsSmall); + + // blockStoneWater4 + const blockStoneWater4 = new BlockStoneWater4(this, 0, 816); + this.add.existing(blockStoneWater4); + + // ankGuard + const ankGuard = new AnkGuard(this, 688, 752); + this.add.existing(ankGuard); + + // sandhold + const sandhold = new Sandhold(this, 496, 880); + this.add.existing(sandhold); + + // sandhold_1 + const sandhold_1 = new Sandhold(this, -816, 720); + this.add.existing(sandhold_1); + + // temple + const temple = new Temple(this, -607, 882); + this.add.existing(temple); + + // tivaraSlingshotFemale + const tivaraSlingshotFemale = new TivaraSlingshotFemale(this, 457, 1095); + this.add.existing(tivaraSlingshotFemale); + + // tivaraWorkerFemale + const tivaraWorkerFemale = new TivaraWorkerFemale(this, -880, 880); + this.add.existing(tivaraWorkerFemale); + + // tivaraWorkerMale + const tivaraWorkerMale = new TivaraWorkerMale(this, -592, 688); + this.add.existing(tivaraWorkerMale); + + // workMill + const workMill = new WorkMill(this, -160, 736); + this.add.existing(workMill); + + // workMill_1 + const workMill_1 = new WorkMill(this, 192, 704); + this.add.existing(workMill_1); + + this.tilemap = tilemap; + + this.events.emit("scene-awake"); + } + + private tilemap!: Phaser.Tilemaps.Tilemap; + + /* START-USER-CODE */ + + // Write your code here + + create() { + this.editorCreate(); + } + + /* END-USER-CODE */ +} + +/* END OF COMPILED CODE */ + +// You can write more code here diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene index 2853e0a0..da6c421e 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene @@ -667,7 +667,7 @@ ], "label": "tree_3", "x": -896, - "y": 1056 + "y": 1040 }, { "prefabId": "ec58b20e-e04f-4bd4-8401-851ffe433f31", @@ -954,7 +954,7 @@ "id": "9cb0db04-e78b-4290-b950-d943f1631f3b", "type": "Tilemap", "label": "tilemap", - "key": "tiles", + "key": "tiles_river_crossing", "tilesets": [ { "name": "tiles", diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts index f1863a27..32a64446 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts @@ -2,7 +2,7 @@ /* START OF COMPILED CODE */ -import Phaser from "phaser"; +import Phaser, { Input } from "phaser"; import Tree7 from "../prefabs/outside/foliage/trees/resources/Tree7"; import Sandhold from "../prefabs/buildings/tivara/Sandhold"; import Owlery from "../prefabs/buildings/skaduwee/Owlery"; @@ -50,6 +50,7 @@ import BlockStoneWater3 from "../prefabs/outside/nature/block_stone_water/BlockS /* START-USER-IMPORTS */ import ActorContainer from "../entity/actor/ActorContainer"; import { AnimatedTilemap } from "./AnimatedTile"; +import { InputHandler } from "../world/managers/controllers/input/input.handler"; /* END-USER-IMPORTS */ export default class MapRiverCrossing extends Phaser.Scene { @@ -63,7 +64,7 @@ export default class MapRiverCrossing extends Phaser.Scene { editorCreate(): void { // tilemap - const tilemap = this.add.tilemap("tiles"); + const tilemap = this.add.tilemap("tiles_river_crossing"); tilemap.addTilesetImage("tiles", "tiles_1"); // tilemap_level_1 @@ -294,7 +295,7 @@ export default class MapRiverCrossing extends Phaser.Scene { this.add.existing(tree1); // tree_3 - const tree_3 = new Tree4(this, -896, 1056); + const tree_3 = new Tree4(this, -896, 1040); this.add.existing(tree_3); // treeTrunk_1 @@ -441,14 +442,29 @@ export default class MapRiverCrossing extends Phaser.Scene { private cursors!: Phaser.Types.Input.Keyboard.CursorKeys; private controlConfig!: Phaser.Types.Cameras.Controls.FixedKeyControlConfig; private controls!: Phaser.Cameras.Controls.FixedKeyControl; - private animatedTilemap!: AnimatedTilemap; preload(): void { - this.cursors = this.input.keyboard!.createCursorKeys(); + this.preloadCursors(); } create() { this.editorCreate(); + this.handleCursors(); + this.handleCameraCenter(); + this.handleZSort(); + this.zoomWithScroll(); + // this.enableLights(); + new AnimatedTilemap(this, this.tilemap, this.tilemap.tilesets); + new InputHandler(this.input, this.cameras.main); + + this.events.once("shutdown", this.destroy, this); + } + + private preloadCursors() { + this.cursors = this.input.keyboard!.createCursorKeys(); + } + + private handleCursors() { this.controlConfig = { camera: this.cameras.main, left: this.cursors.left, @@ -458,12 +474,6 @@ export default class MapRiverCrossing extends Phaser.Scene { speed: 2 }; this.controls = new Phaser.Cameras.Controls.FixedKeyControl(this.controlConfig); - this.handleCameraCenter(); - this.handleZSort(); - this.zoomWithScroll(); - // this.enableLights(); - this.animatedTilemap = new AnimatedTilemap(this.tilemap, this.tilemap.tilesets[0]); - this.events.once("shutdown", this.destroy, this); } enableLights = () => { @@ -535,7 +545,7 @@ export default class MapRiverCrossing extends Phaser.Scene { }; zoomWithScroll = () => { - this.input.on("wheel", this.zoomWithScrollHandler); + this.input.on(Input.Events.POINTER_WHEEL, this.zoomWithScrollHandler); }; zoomWithScrollHandler = (pointer: any, gameObjects: any, deltaX: any, deltaY: any, deltaZ: any) => { @@ -555,7 +565,6 @@ export default class MapRiverCrossing extends Phaser.Scene { update(time: number, delta: number): void { this.controls.update(delta); - this.animatedTilemap.update(delta); } private destroy() { diff --git a/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts b/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts index 9a551a90..5f7c89b3 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts @@ -5,7 +5,6 @@ import Phaser from "phaser"; import PreloadBarUpdaterScript from "../../../other/Template/script-nodes/PreloadBarUpdaterScript"; /* START-USER-IMPORTS */ -import assetPackUrl from "../../../../assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json"; /* END-USER-IMPORTS */ export default class PreloadProbableWaffle extends Phaser.Scene { @@ -53,16 +52,43 @@ export default class PreloadProbableWaffle extends Phaser.Scene { preload() { this.editorCreate(); - this.load.pack("asset-pack", assetPackUrl as any); + this.load.pack("asset-pack", "assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json"); + const map = this.getMap(); + this.load.pack("asset-pack-map", map.assetPath); } create() { - this.scene.start("MapRiverCrossing"); + const map = this.getMap(); + this.scene.start(map.sceneKey); + } + + getMap(): MapType { + // eslint-disable-next-line prefer-const + let mapId = 1; // todo get from somewhere else + switch (mapId) { + case 1: + return { + sceneKey: "MapRiverCrossing", + assetPath: "assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-river-crossing.json" + }; + case 2: + return { + sceneKey: "MapEmberEnclave", + assetPath: "assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-ember-enclave.json" + }; + default: + throw new Error(`Map id ${mapId} not found`); + } } /* END-USER-CODE */ } +type MapType = { + sceneKey: string; + assetPath: string; +}; + /* END OF COMPILED CODE */ // You can write more code here diff --git a/apps/client/src/assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json b/apps/client/src/assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json index 1fde73b3..b863bc8c 100644 --- a/apps/client/src/assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json +++ b/apps/client/src/assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json @@ -312,26 +312,6 @@ "type": "spritesheet", "key": "slingshot_female_walk" }, - { - "url": "assets/probable-waffle/tilemaps/river_crossing.json", - "path": "assets/probable-waffle/tilemaps/river_crossing.json", - "type": "tilemapTiledJSON", - "key": "tiles" - }, - { - "url": "assets/probable-waffle/tilesets/tiles.png", - "path": "assets/probable-waffle/tilesets/tiles.png", - "frameConfig": { - "frameWidth": 64, - "frameHeight": 32, - "startFrame": 0, - "endFrame": -1, - "spacing": 0, - "margin": 0 - }, - "type": "spritesheet", - "key": "tiles_1" - }, { "url": "assets/probable-waffle/spritesheets/characters/general/warrior/warrior_anim.json", "path": "assets/probable-waffle/spritesheets/characters/general/warrior/warrior_anim.json", diff --git a/apps/client/src/assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-ember-enclave.json b/apps/client/src/assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-ember-enclave.json new file mode 100644 index 00000000..b7255d4e --- /dev/null +++ b/apps/client/src/assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-ember-enclave.json @@ -0,0 +1,33 @@ +{ + "section1": { + "files": [ + { + "url": "assets/probable-waffle/tilemaps/ember_enclave.json", + "path": "assets/probable-waffle/tilemaps/ember_enclave.json", + "type": "tilemapTiledJSON", + "key": "tiles_ember_enclave" + }, + { + "url": "assets/probable-waffle/tilesets/tiles.png", + "path": "assets/probable-waffle/tilesets/tiles.png", + "frameConfig": { + "frameWidth": 64, + "frameHeight": 32, + "startFrame": 0, + "endFrame": -1, + "spacing": 0, + "margin": 0 + }, + "type": "spritesheet", + "key": "tiles_1" + } + ] + }, + "meta": { + "app": "Phaser Editor 2D - Asset Pack Editor", + "contentType": "phasereditor2d.pack.core.AssetContentType", + "url": "https://phasereditor2d.com", + "version": 2, + "showAllFilesInBlocks": false + } +} diff --git a/apps/client/src/assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-river-crossing.json b/apps/client/src/assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-river-crossing.json new file mode 100644 index 00000000..6db58a14 --- /dev/null +++ b/apps/client/src/assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-river-crossing.json @@ -0,0 +1,33 @@ +{ + "section1": { + "files": [ + { + "url": "assets/probable-waffle/tilemaps/river_crossing.json", + "path": "assets/probable-waffle/tilemaps/river_crossing.json", + "type": "tilemapTiledJSON", + "key": "tiles_river_crossing" + }, + { + "url": "assets/probable-waffle/tilesets/tiles.png", + "path": "assets/probable-waffle/tilesets/tiles.png", + "frameConfig": { + "frameWidth": 64, + "frameHeight": 32, + "startFrame": 0, + "endFrame": -1, + "spacing": 0, + "margin": 0 + }, + "type": "spritesheet", + "key": "tiles_1" + } + ] + }, + "meta": { + "app": "Phaser Editor 2D - Asset Pack Editor", + "contentType": "phasereditor2d.pack.core.AssetContentType", + "url": "https://phasereditor2d.com", + "version": 2, + "showAllFilesInBlocks": false + } +} diff --git a/apps/client/src/assets/probable-waffle/tilemaps/ember_enclave.json b/apps/client/src/assets/probable-waffle/tilemaps/ember_enclave.json new file mode 100644 index 00000000..3584c714 --- /dev/null +++ b/apps/client/src/assets/probable-waffle/tilemaps/ember_enclave.json @@ -0,0 +1,5815 @@ +{ + "compressionlevel": -1, + "height": 50, + "infinite": false, + "layers": [ + { + "data": [ + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 6, + 22, + 145, + 146, + 146, + 146, + 146, + 147, + 20, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 18, + 145, + 161, + 12, + 12, + 12, + 12, + 159, + 21, + 8, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 18, + 157, + 12, + 12, + 12, + 12, + 12, + 160, + 147, + 20, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 18, + 169, + 149, + 12, + 12, + 12, + 12, + 12, + 159, + 20, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 30, + 10, + 169, + 149, + 12, + 12, + 12, + 12, + 159, + 20, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 30, + 10, + 169, + 149, + 12, + 12, + 12, + 159, + 20, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 30, + 10, + 157, + 12, + 12, + 12, + 159, + 20, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 18, + 169, + 149, + 148, + 170, + 171, + 20, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 30, + 10, + 169, + 171, + 9, + 43, + 32, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 30, + 31, + 31, + 32, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 40, + 41, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23, + 23 + ], + "height": 50, + "id": 1, + "name": "TileMap_level_1", + "opacity": 1, + "type": "tilelayer", + "visible": true, + "width": 50, + "x": 0, + "y": 0 + } + ], + "nextlayerid": 13, + "nextobjectid": 88, + "orientation": "isometric", + "renderorder": "right-down", + "tiledversion": "1.10.2", + "tileheight": 32, + "tilesets": [ + { + "columns": 12, + "firstgid": 1, + "grid": { + "height": 32, + "orientation": "isometric", + "width": 64 + }, + "image": "..\/tilesets\/tiles.png", + "imageheight": 768, + "imagewidth": 768, + "margin": 0, + "name": "tiles", + "spacing": 0, + "tilecount": 288, + "tileheight": 32, + "tiles": [ + { + "animation": [ + { + "duration": 1300, + "tileid": 23 + }, + { + "duration": 1300, + "tileid": 35 + }, + { + "duration": 1300, + "tileid": 34 + } + ], + "id": 23 + }, + { + "animation": [ + { + "duration": 1000, + "tileid": 34 + }, + { + "duration": 1000, + "tileid": 35 + }, + { + "duration": 1000, + "tileid": 23 + } + ], + "id": 34 + }, + { + "animation": [ + { + "duration": 1500, + "tileid": 35 + }, + { + "duration": 1500, + "tileid": 23 + }, + { + "duration": 1500, + "tileid": 34 + } + ], + "id": 35 + } + ], + "tilewidth": 64, + "wangsets": [ + { + "colors": [ + { + "color": "#ff0000", + "name": "Sand", + "probability": 1, + "tile": 10 + }, + { + "color": "#00ff00", + "name": "Stone", + "probability": 1, + "tile": 22 + }, + { + "color": "#0000ff", + "name": "Water", + "probability": 1, + "tile": 34 + }, + { + "color": "#ff7700", + "name": "Grass light", + "probability": 1, + "tile": 11 + }, + { + "color": "#00e9ff", + "name": "Open water", + "probability": 1, + "tile": 47 + }, + { + "color": "#ff00d8", + "name": "Snow", + "probability": 1, + "tile": 59 + }, + { + "color": "#ffff00", + "name": "Ice", + "probability": 1, + "tile": 71 + } + ], + "name": "Tiles terrain set", + "tile": -1, + "type": "corner", + "wangtiles": [ + { + "tileid": 0, + "wangid": [ + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0 + ] + }, + { + "tileid": 1, + "wangid": [ + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 0 + ] + }, + { + "tileid": 2, + "wangid": [ + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0 + ] + }, + { + "tileid": 3, + "wangid": [ + 0, + 1, + 0, + 0, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 4, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 1 + ] + }, + { + "tileid": 5, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 6, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 7, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 8, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 9, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 10, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 11, + "wangid": [ + 0, + 4, + 0, + 4, + 0, + 4, + 0, + 4 + ] + }, + { + "tileid": 12, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0 + ] + }, + { + "tileid": 14, + "wangid": [ + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 15, + "wangid": [ + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 16, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0 + ] + }, + { + "tileid": 17, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 19, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 20, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 21, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 22, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 23, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 24, + "wangid": [ + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + { + "tileid": 25, + "wangid": [ + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1 + ] + }, + { + "tileid": 26, + "wangid": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1 + ] + }, + { + "tileid": 27, + "wangid": [ + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1 + ] + }, + { + "tileid": 28, + "wangid": [ + 0, + 1, + 0, + 0, + 0, + 1, + 0, + 0 + ] + }, + { + "tileid": 29, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 30, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 31, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 32, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 33, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 34, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 35, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 36, + "wangid": [ + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 0 + ] + }, + { + "tileid": 37, + "wangid": [ + 0, + 0, + 0, + 2, + 0, + 2, + 0, + 0 + ] + }, + { + "tileid": 38, + "wangid": [ + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 0 + ] + }, + { + "tileid": 39, + "wangid": [ + 0, + 2, + 0, + 0, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 40, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 0, + 0, + 2 + ] + }, + { + "tileid": 41, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 0, + 0, + 1 + ] + }, + { + "tileid": 42, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 43, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 0, + 0, + 1 + ] + }, + { + "tileid": 44, + "wangid": [ + 0, + 1, + 0, + 0, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 45, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 0, + 0, + 1 + ] + }, + { + "tileid": 46, + "wangid": [ + 0, + 1, + 0, + 0, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 47, + "wangid": [ + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5 + ] + }, + { + "tileid": 48, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 0, + 0, + 0 + ] + }, + { + "tileid": 50, + "wangid": [ + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 51, + "wangid": [ + 0, + 0, + 0, + 2, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 52, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 2, + 0, + 0 + ] + }, + { + "tileid": 53, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 1, + 0, + 0 + ] + }, + { + "tileid": 54, + "wangid": [ + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 55, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 1, + 0, + 0 + ] + }, + { + "tileid": 56, + "wangid": [ + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 57, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 1, + 0, + 0 + ] + }, + { + "tileid": 58, + "wangid": [ + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 59, + "wangid": [ + 0, + 6, + 0, + 6, + 0, + 6, + 0, + 6 + ] + }, + { + "tileid": 60, + "wangid": [ + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + { + "tileid": 61, + "wangid": [ + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 2 + ] + }, + { + "tileid": 62, + "wangid": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2 + ] + }, + { + "tileid": 63, + "wangid": [ + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 2 + ] + }, + { + "tileid": 64, + "wangid": [ + 0, + 2, + 0, + 0, + 0, + 2, + 0, + 0 + ] + }, + { + "tileid": 65, + "wangid": [ + 0, + 2, + 0, + 0, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 66, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 2 + ] + }, + { + "tileid": 67, + "wangid": [ + 0, + 2, + 0, + 0, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 68, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 0, + 0, + 2 + ] + }, + { + "tileid": 69, + "wangid": [ + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 1 + ] + }, + { + "tileid": 70, + "wangid": [ + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 2 + ] + }, + { + "tileid": 71, + "wangid": [ + 0, + 7, + 0, + 7, + 0, + 7, + 0, + 7 + ] + }, + { + "tileid": 72, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 73, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 74, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 75, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 76, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 77, + "wangid": [ + 0, + 0, + 0, + 2, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 78, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 2, + 0, + 0 + ] + }, + { + "tileid": 79, + "wangid": [ + 0, + 0, + 0, + 2, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 80, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 2, + 0, + 0 + ] + }, + { + "tileid": 81, + "wangid": [ + 0, + 0, + 0, + 2, + 0, + 1, + 0, + 0 + ] + }, + { + "tileid": 82, + "wangid": [ + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 0 + ] + }, + { + "tileid": 84, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 86, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 87, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 88, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 89, + "wangid": [ + 0, + 0, + 0, + 2, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 90, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 2, + 0, + 0 + ] + }, + { + "tileid": 91, + "wangid": [ + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 1 + ] + }, + { + "tileid": 92, + "wangid": [ + 0, + 1, + 0, + 0, + 0, + 2, + 0, + 0 + ] + }, + { + "tileid": 93, + "wangid": [ + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 94, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 0, + 0, + 0 + ] + }, + { + "tileid": 96, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 97, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 98, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 99, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 100, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 101, + "wangid": [ + 0, + 2, + 0, + 0, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 102, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 0, + 0, + 2 + ] + }, + { + "tileid": 103, + "wangid": [ + 0, + 2, + 0, + 0, + 0, + 1, + 0, + 0 + ] + }, + { + "tileid": 104, + "wangid": [ + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 2 + ] + }, + { + "tileid": 105, + "wangid": [ + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 106, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 0, + 0, + 0 + ] + }, + { + "tileid": 108, + "wangid": [ + 0, + 3, + 0, + 2, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 109, + "wangid": [ + 0, + 3, + 0, + 2, + 0, + 2, + 0, + 3 + ] + }, + { + "tileid": 110, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 2, + 0, + 3 + ] + }, + { + "tileid": 111, + "wangid": [ + 0, + 2, + 0, + 3, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 112, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 3, + 0, + 2 + ] + }, + { + "tileid": 113, + "wangid": [ + 0, + 2, + 0, + 3, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 114, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 3, + 0, + 2 + ] + }, + { + "tileid": 115, + "wangid": [ + 0, + 3, + 0, + 2, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 116, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 2, + 0, + 3 + ] + }, + { + "tileid": 117, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 118, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 120, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 122, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 123, + "wangid": [ + 0, + 3, + 0, + 2, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 124, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 2, + 0, + 3 + ] + }, + { + "tileid": 125, + "wangid": [ + 0, + 3, + 0, + 2, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 126, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 2, + 0, + 3 + ] + }, + { + "tileid": 127, + "wangid": [ + 0, + 2, + 0, + 3, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 128, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 2 + ] + }, + { + "tileid": 129, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 130, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 132, + "wangid": [ + 0, + 2, + 0, + 3, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 133, + "wangid": [ + 0, + 2, + 0, + 3, + 0, + 3, + 0, + 2 + ] + }, + { + "tileid": 134, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 3, + 0, + 2 + ] + }, + { + "tileid": 135, + "wangid": [ + 0, + 3, + 0, + 2, + 0, + 3, + 0, + 2 + ] + }, + { + "tileid": 136, + "wangid": [ + 0, + 2, + 0, + 3, + 0, + 2, + 0, + 3 + ] + }, + { + "tileid": 137, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 138, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 139, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 3, + 0, + 2 + ] + }, + { + "tileid": 140, + "wangid": [ + 0, + 2, + 0, + 3, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 141, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 142, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 144, + "wangid": [ + 0, + 1, + 0, + 4, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 145, + "wangid": [ + 0, + 1, + 0, + 4, + 0, + 4, + 0, + 1 + ] + }, + { + "tileid": 146, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 4, + 0, + 1 + ] + }, + { + "tileid": 147, + "wangid": [ + 0, + 4, + 0, + 1, + 0, + 4, + 0, + 4 + ] + }, + { + "tileid": 148, + "wangid": [ + 0, + 4, + 0, + 4, + 0, + 1, + 0, + 4 + ] + }, + { + "tileid": 149, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 2, + 0, + 2 + ] + }, + { + "tileid": 150, + "wangid": [ + 0, + 2, + 0, + 2, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 151, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 2, + 0, + 3 + ] + }, + { + "tileid": 152, + "wangid": [ + 0, + 3, + 0, + 2, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 153, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 154, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 156, + "wangid": [ + 0, + 4, + 0, + 4, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 158, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 4, + 0, + 4 + ] + }, + { + "tileid": 159, + "wangid": [ + 0, + 1, + 0, + 4, + 0, + 4, + 0, + 4 + ] + }, + { + "tileid": 160, + "wangid": [ + 0, + 4, + 0, + 4, + 0, + 4, + 0, + 1 + ] + }, + { + "tileid": 161, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 3, + 0, + 2 + ] + }, + { + "tileid": 162, + "wangid": [ + 0, + 2, + 0, + 3, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 163, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 1, + 0, + 2 + ] + }, + { + "tileid": 164, + "wangid": [ + 0, + 2, + 0, + 1, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 165, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 3, + 0, + 2 + ] + }, + { + "tileid": 166, + "wangid": [ + 0, + 2, + 0, + 3, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 168, + "wangid": [ + 0, + 4, + 0, + 1, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 169, + "wangid": [ + 0, + 4, + 0, + 1, + 0, + 1, + 0, + 4 + ] + }, + { + "tileid": 170, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 4 + ] + }, + { + "tileid": 171, + "wangid": [ + 0, + 1, + 0, + 4, + 0, + 1, + 0, + 4 + ] + }, + { + "tileid": 172, + "wangid": [ + 0, + 4, + 0, + 1, + 0, + 4, + 0, + 1 + ] + }, + { + "tileid": 173, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 2, + 0, + 3 + ] + }, + { + "tileid": 174, + "wangid": [ + 0, + 3, + 0, + 2, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 175, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 2, + 0, + 1 + ] + }, + { + "tileid": 176, + "wangid": [ + 0, + 1, + 0, + 2, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 177, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 2, + 0, + 3 + ] + }, + { + "tileid": 178, + "wangid": [ + 0, + 3, + 0, + 2, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 180, + "wangid": [ + 0, + 4, + 0, + 3, + 0, + 4, + 0, + 4 + ] + }, + { + "tileid": 181, + "wangid": [ + 0, + 4, + 0, + 3, + 0, + 3, + 0, + 4 + ] + }, + { + "tileid": 182, + "wangid": [ + 0, + 4, + 0, + 4, + 0, + 3, + 0, + 4 + ] + }, + { + "tileid": 183, + "wangid": [ + 0, + 3, + 0, + 4, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 184, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 4, + 0, + 3 + ] + }, + { + "tileid": 185, + "wangid": [ + 0, + 3, + 0, + 4, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 186, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 4, + 0, + 3 + ] + }, + { + "tileid": 187, + "wangid": [ + 0, + 4, + 0, + 3, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 188, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 3, + 0, + 4 + ] + }, + { + "tileid": 189, + "wangid": [ + 0, + 4, + 0, + 4, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 190, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 4, + 0, + 4 + ] + }, + { + "tileid": 192, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 4, + 0, + 4 + ] + }, + { + "tileid": 194, + "wangid": [ + 0, + 4, + 0, + 4, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 195, + "wangid": [ + 0, + 4, + 0, + 3, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 196, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 3, + 0, + 4 + ] + }, + { + "tileid": 197, + "wangid": [ + 0, + 4, + 0, + 3, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 198, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 3, + 0, + 4 + ] + }, + { + "tileid": 199, + "wangid": [ + 0, + 3, + 0, + 4, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 200, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 4, + 0, + 3 + ] + }, + { + "tileid": 201, + "wangid": [ + 0, + 4, + 0, + 4, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 202, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 4, + 0, + 4 + ] + }, + { + "tileid": 204, + "wangid": [ + 0, + 3, + 0, + 4, + 0, + 4, + 0, + 4 + ] + }, + { + "tileid": 205, + "wangid": [ + 0, + 3, + 0, + 4, + 0, + 4, + 0, + 3 + ] + }, + { + "tileid": 206, + "wangid": [ + 0, + 4, + 0, + 4, + 0, + 4, + 0, + 3 + ] + }, + { + "tileid": 207, + "wangid": [ + 0, + 4, + 0, + 3, + 0, + 4, + 0, + 3 + ] + }, + { + "tileid": 208, + "wangid": [ + 0, + 3, + 0, + 4, + 0, + 3, + 0, + 4 + ] + }, + { + "tileid": 209, + "wangid": [ + 0, + 4, + 0, + 1, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 210, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 1, + 0, + 4 + ] + }, + { + "tileid": 211, + "wangid": [ + 0, + 4, + 0, + 1, + 0, + 4, + 0, + 3 + ] + }, + { + "tileid": 212, + "wangid": [ + 0, + 3, + 0, + 4, + 0, + 1, + 0, + 4 + ] + }, + { + "tileid": 213, + "wangid": [ + 0, + 4, + 0, + 1, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 214, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 1, + 0, + 4 + ] + }, + { + "tileid": 216, + "wangid": [ + 0, + 7, + 0, + 6, + 0, + 7, + 0, + 7 + ] + }, + { + "tileid": 217, + "wangid": [ + 0, + 7, + 0, + 6, + 0, + 6, + 0, + 7 + ] + }, + { + "tileid": 218, + "wangid": [ + 0, + 7, + 0, + 7, + 0, + 6, + 0, + 7 + ] + }, + { + "tileid": 219, + "wangid": [ + 0, + 6, + 0, + 7, + 0, + 6, + 0, + 6 + ] + }, + { + "tileid": 220, + "wangid": [ + 0, + 6, + 0, + 6, + 0, + 7, + 0, + 6 + ] + }, + { + "tileid": 221, + "wangid": [ + 0, + 1, + 0, + 4, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 222, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 4, + 0, + 1 + ] + }, + { + "tileid": 223, + "wangid": [ + 0, + 1, + 0, + 4, + 0, + 3, + 0, + 4 + ] + }, + { + "tileid": 224, + "wangid": [ + 0, + 4, + 0, + 3, + 0, + 4, + 0, + 1 + ] + }, + { + "tileid": 225, + "wangid": [ + 0, + 1, + 0, + 4, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 226, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 4, + 0, + 1 + ] + }, + { + "tileid": 228, + "wangid": [ + 0, + 6, + 0, + 6, + 0, + 7, + 0, + 7 + ] + }, + { + "tileid": 230, + "wangid": [ + 0, + 7, + 0, + 7, + 0, + 6, + 0, + 6 + ] + }, + { + "tileid": 231, + "wangid": [ + 0, + 7, + 0, + 6, + 0, + 6, + 0, + 6 + ] + }, + { + "tileid": 232, + "wangid": [ + 0, + 6, + 0, + 6, + 0, + 6, + 0, + 7 + ] + }, + { + "tileid": 233, + "wangid": [ + 0, + 1, + 0, + 4, + 0, + 4, + 0, + 3 + ] + }, + { + "tileid": 234, + "wangid": [ + 0, + 3, + 0, + 4, + 0, + 4, + 0, + 1 + ] + }, + { + "tileid": 235, + "wangid": [ + 0, + 1, + 0, + 4, + 0, + 1, + 0, + 3 + ] + }, + { + "tileid": 236, + "wangid": [ + 0, + 3, + 0, + 1, + 0, + 4, + 0, + 1 + ] + }, + { + "tileid": 237, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 4, + 0, + 3 + ] + }, + { + "tileid": 238, + "wangid": [ + 0, + 3, + 0, + 4, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 240, + "wangid": [ + 0, + 6, + 0, + 7, + 0, + 7, + 0, + 7 + ] + }, + { + "tileid": 241, + "wangid": [ + 0, + 6, + 0, + 7, + 0, + 7, + 0, + 6 + ] + }, + { + "tileid": 242, + "wangid": [ + 0, + 7, + 0, + 7, + 0, + 7, + 0, + 6 + ] + }, + { + "tileid": 243, + "wangid": [ + 0, + 7, + 0, + 6, + 0, + 7, + 0, + 6 + ] + }, + { + "tileid": 244, + "wangid": [ + 0, + 6, + 0, + 7, + 0, + 6, + 0, + 7 + ] + }, + { + "tileid": 245, + "wangid": [ + 0, + 4, + 0, + 1, + 0, + 3, + 0, + 4 + ] + }, + { + "tileid": 246, + "wangid": [ + 0, + 4, + 0, + 3, + 0, + 1, + 0, + 4 + ] + }, + { + "tileid": 247, + "wangid": [ + 0, + 4, + 0, + 1, + 0, + 3, + 0, + 1 + ] + }, + { + "tileid": 248, + "wangid": [ + 0, + 1, + 0, + 3, + 0, + 1, + 0, + 4 + ] + }, + { + "tileid": 249, + "wangid": [ + 0, + 1, + 0, + 1, + 0, + 3, + 0, + 4 + ] + }, + { + "tileid": 250, + "wangid": [ + 0, + 4, + 0, + 3, + 0, + 1, + 0, + 1 + ] + }, + { + "tileid": 252, + "wangid": [ + 0, + 7, + 0, + 3, + 0, + 7, + 0, + 7 + ] + }, + { + "tileid": 253, + "wangid": [ + 0, + 7, + 0, + 3, + 0, + 3, + 0, + 7 + ] + }, + { + "tileid": 254, + "wangid": [ + 0, + 7, + 0, + 7, + 0, + 3, + 0, + 7 + ] + }, + { + "tileid": 255, + "wangid": [ + 0, + 3, + 0, + 7, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 256, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 7, + 0, + 3 + ] + }, + { + "tileid": 264, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 7, + 0, + 7 + ] + }, + { + "tileid": 266, + "wangid": [ + 0, + 7, + 0, + 7, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 267, + "wangid": [ + 0, + 7, + 0, + 3, + 0, + 3, + 0, + 3 + ] + }, + { + "tileid": 268, + "wangid": [ + 0, + 3, + 0, + 3, + 0, + 3, + 0, + 7 + ] + }, + { + "tileid": 276, + "wangid": [ + 0, + 3, + 0, + 7, + 0, + 7, + 0, + 7 + ] + }, + { + "tileid": 277, + "wangid": [ + 0, + 3, + 0, + 7, + 0, + 7, + 0, + 3 + ] + }, + { + "tileid": 278, + "wangid": [ + 0, + 7, + 0, + 7, + 0, + 7, + 0, + 3 + ] + }, + { + "tileid": 279, + "wangid": [ + 0, + 7, + 0, + 3, + 0, + 7, + 0, + 3 + ] + }, + { + "tileid": 280, + "wangid": [ + 0, + 3, + 0, + 7, + 0, + 3, + 0, + 7 + ] + } + ] + } + ] + } + ], + "tilewidth": 64, + "type": "map", + "version": "1.10", + "width": 50 +} diff --git a/apps/client/src/metadata/probable-waffle/tilemaps/ember_enclave.tmx b/apps/client/src/metadata/probable-waffle/tilemaps/ember_enclave.tmx new file mode 100644 index 00000000..fb29ae18 --- /dev/null +++ b/apps/client/src/metadata/probable-waffle/tilemaps/ember_enclave.tmx @@ -0,0 +1,62 @@ + + + + + + + + + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,6,7,7,7,7,7,7,8,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,6,22,145,146,146,146,146,147,20,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,18,145,161,12,12,12,12,159,21,8,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,18,157,12,12,12,12,12,160,147,20,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,18,169,149,12,12,12,12,12,159,20,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,30,10,169,149,12,12,12,12,159,20,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,30,10,169,149,12,12,12,159,20,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,30,10,157,12,12,12,159,20,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,18,169,149,148,170,171,20,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,30,10,169,171,9,43,32,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,30,31,31,32,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,40,41,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23 + + + From 4e2a5e19b9fd1c2c2dc2bfcc063c838cd29cabbb Mon Sep 17 00:00:00 2001 From: Jernej Habjan Date: Mon, 18 Dec 2023 19:06:32 +0100 Subject: [PATCH 004/138] Handlers to separate classes --- ...berEnclave.scene => MapEmberEnclave.scene} | 6 +- .../{EmberEnclave.ts => MapEmberEnclave.ts} | 17 +- .../game/scenes/MapRiverCrossing.ts | 138 +------------ .../game/scenes/PreloadProbableWaffle.ts | 2 +- .../game/world/const/game-config.ts | 3 +- .../input/DEPRECATED_input.handler.ts | 182 ++++++++++++++++++ .../controllers/input/input.handler.ts | 92 ++++++--- .../world/map/DEPRECATED_scale.handler.ts | 47 +++++ .../game/world/map/depth.helper.ts | 20 ++ .../game/world/map/scale.handler.ts | 46 +++-- .../game/world/map/vision/lights.handler.ts | 62 ++++++ .../game/world/scenes/grassland.scene.ts | 12 +- 12 files changed, 442 insertions(+), 185 deletions(-) rename apps/client/src/app/probable-waffle/game/scenes/{EmberEnclave.scene => MapEmberEnclave.scene} (98%) rename apps/client/src/app/probable-waffle/game/scenes/{EmberEnclave.ts => MapEmberEnclave.ts} (83%) create mode 100644 apps/client/src/app/probable-waffle/game/world/managers/controllers/input/DEPRECATED_input.handler.ts create mode 100644 apps/client/src/app/probable-waffle/game/world/map/DEPRECATED_scale.handler.ts create mode 100644 apps/client/src/app/probable-waffle/game/world/map/depth.helper.ts create mode 100644 apps/client/src/app/probable-waffle/game/world/map/vision/lights.handler.ts diff --git a/apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.scene b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene similarity index 98% rename from apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.scene rename to apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene index fb78eac7..08ccc78b 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.scene +++ b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene @@ -7,7 +7,7 @@ "autoImport": true, "preloadPackFiles": [], "createMethodName": "editorCreate", - "sceneKey": "EmberEnclave", + "sceneKey": "MapEmberEnclave", "compilerOutputLanguage": "TYPE_SCRIPT", "borderWidth": 1280, "borderHeight": 720 @@ -54,8 +54,8 @@ "y" ], "label": "blockObsidianLava4", - "x": 192, - "y": 560 + "x": 208, + "y": 544 }, { "prefabId": "ec58b20e-e04f-4bd4-8401-856e1e433f46", diff --git a/apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.ts b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts similarity index 83% rename from apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.ts rename to apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts index 6b46a140..ad1f4104 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/EmberEnclave.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts @@ -18,11 +18,16 @@ import TivaraWorkerFemale from "../prefabs/characters/tivara/TivaraWorkerFemale" import TivaraWorkerMale from "../prefabs/characters/tivara/TivaraWorkerMale"; import WorkMill from "../prefabs/buildings/tivara/WorkMill"; /* START-USER-IMPORTS */ +import { ScaleHandler } from "../world/map/scale.handler"; +import { InputHandler } from "../world/managers/controllers/input/input.handler"; +import { LightsHandler } from "../world/map/vision/lights.handler"; +import { DepthHelper } from "../world/map/depth.helper"; +import { AnimatedTilemap } from "./AnimatedTile"; /* END-USER-IMPORTS */ -export default class EmberEnclave extends Phaser.Scene { +export default class MapEmberEnclave extends Phaser.Scene { constructor() { - super("EmberEnclave"); + super("MapEmberEnclave"); /* START-USER-CTR-CODE */ // Write your code here. @@ -46,7 +51,7 @@ export default class EmberEnclave extends Phaser.Scene { this.add.existing(bushDownwardsLarge); // blockObsidianLava4 - const blockObsidianLava4 = new BlockObsidianLava4(this, 192, 560); + const blockObsidianLava4 = new BlockObsidianLava4(this, 208, 544); this.add.existing(blockObsidianLava4); // tree6 @@ -114,6 +119,12 @@ export default class EmberEnclave extends Phaser.Scene { create() { this.editorCreate(); + + new ScaleHandler(this, this.tilemap, { margins: { left: 150, bottom: 100 }, maxLayers: 8 }); + new InputHandler(this); + new LightsHandler(this, { enableLights: false }); + new DepthHelper(this); + new AnimatedTilemap(this, this.tilemap, this.tilemap.tilesets); } /* END-USER-CODE */ diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts index 32a64446..846279a2 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts @@ -2,7 +2,7 @@ /* START OF COMPILED CODE */ -import Phaser, { Input } from "phaser"; +import Phaser from "phaser"; import Tree7 from "../prefabs/outside/foliage/trees/resources/Tree7"; import Sandhold from "../prefabs/buildings/tivara/Sandhold"; import Owlery from "../prefabs/buildings/skaduwee/Owlery"; @@ -48,9 +48,11 @@ import BlockStoneWater1 from "../prefabs/outside/nature/block_stone_water/BlockS import BlockStoneWater4 from "../prefabs/outside/nature/block_stone_water/BlockStoneWater4"; import BlockStoneWater3 from "../prefabs/outside/nature/block_stone_water/BlockStoneWater3"; /* START-USER-IMPORTS */ -import ActorContainer from "../entity/actor/ActorContainer"; import { AnimatedTilemap } from "./AnimatedTile"; +import { ScaleHandler } from "../world/map/scale.handler"; import { InputHandler } from "../world/managers/controllers/input/input.handler"; +import { LightsHandler } from "../world/map/vision/lights.handler"; +import { DepthHelper } from "../world/map/depth.helper"; /* END-USER-IMPORTS */ export default class MapRiverCrossing extends Phaser.Scene { @@ -439,136 +441,14 @@ export default class MapRiverCrossing extends Phaser.Scene { private tilemap!: Phaser.Tilemaps.Tilemap; /* START-USER-CODE */ - private cursors!: Phaser.Types.Input.Keyboard.CursorKeys; - private controlConfig!: Phaser.Types.Cameras.Controls.FixedKeyControlConfig; - private controls!: Phaser.Cameras.Controls.FixedKeyControl; - - preload(): void { - this.preloadCursors(); - } - create() { this.editorCreate(); - this.handleCursors(); - this.handleCameraCenter(); - this.handleZSort(); - this.zoomWithScroll(); - // this.enableLights(); - new AnimatedTilemap(this, this.tilemap, this.tilemap.tilesets); - new InputHandler(this.input, this.cameras.main); - this.events.once("shutdown", this.destroy, this); - } - - private preloadCursors() { - this.cursors = this.input.keyboard!.createCursorKeys(); - } - - private handleCursors() { - this.controlConfig = { - camera: this.cameras.main, - left: this.cursors.left, - right: this.cursors.right, - up: this.cursors.up, - down: this.cursors.down, - speed: 2 - }; - this.controls = new Phaser.Cameras.Controls.FixedKeyControl(this.controlConfig); - } - - enableLights = () => { - // add lights2d pipeline to all children - this.children.each((child: any) => { - if (child.setPipeline) { - child.setPipeline("Light2D"); - } - // if instanceOf ActorContainer, then add lights2d pipeline to all children of the container - if (child instanceof ActorContainer) { - child.each((child: any) => { - if (child.setPipeline) { - child.setPipeline("Light2D"); - } - }); - } - }); - - this.lights.enable(); - this.lights.setAmbientColor(0x808080); - - const spotlight = this.lights.addLight(400, 300, 280).setIntensity(2); - - this.input.on("pointermove", (pointer: any) => { - const cameraX = this.cameras.main.scrollX; - const cameraY = this.cameras.main.scrollY; - const zoom = this.cameras.main.zoom; - - // Adjust the pointer position based on the inverse of the zoom - const adjustedPointerX = (pointer.x + cameraX) / zoom; - const adjustedPointerY = (pointer.y + cameraY) / zoom; - - spotlight.x = adjustedPointerX; - spotlight.y = adjustedPointerY; - }); - - spotlight.setColor(0xffffff); - }; - - handleZSort = () => { - this.children.each((child: any) => { - if (!child.setDepth) return; - child.setDepth(child.y); - if (child instanceof ActorContainer) { - const z = child.z; - child.setDepth(child.y + z * 2); - } - }); - }; - handleCameraCenter = () => { - // set camera to the center of isometric tilemap - - const maxMapLayers = 8; - // noinspection UnnecessaryLocalVariableJS - const topMarginDueToMapLayers = maxMapLayers * 32; - const topMargin = topMarginDueToMapLayers; - // noinspection UnnecessaryLocalVariableJS - const leftMarginDueToHud = 150; - const leftMargin = leftMarginDueToHud; - // noinspection UnnecessaryLocalVariableJS - const bottomMarginDueToHud = 100; - const bottomMargin = bottomMarginDueToHud; - const mapLeft = -this.tilemap.widthInPixels / 2 - leftMargin; - const mapRight = +this.tilemap.widthInPixels / 2; - const mapTop = -topMargin; - const mapBottom = this.tilemap.heightInPixels + bottomMargin; - - this.cameras.main.setBounds(mapLeft, mapTop, mapRight - mapLeft, mapBottom - mapTop, true); - }; - - zoomWithScroll = () => { - this.input.on(Input.Events.POINTER_WHEEL, this.zoomWithScrollHandler); - }; - - zoomWithScrollHandler = (pointer: any, gameObjects: any, deltaX: any, deltaY: any, deltaZ: any) => { - if (deltaY > 0) { - this.cameras.main.zoom -= 0.1; - } else { - this.cameras.main.zoom += 0.1; - } - // calculate min-zoom by map size - const minZoom = Math.min( - this.cameras.main.width / this.tilemap.widthInPixels, - this.cameras.main.height / this.tilemap.heightInPixels - ); - if (this.cameras.main.zoom < minZoom) this.cameras.main.zoom = minZoom; - if (this.cameras.main.zoom > 10) this.cameras.main.zoom = 10; - }; - - update(time: number, delta: number): void { - this.controls.update(delta); - } - - private destroy() { - this.input.off("wheel", this.zoomWithScrollHandler); + new ScaleHandler(this, this.tilemap, { margins: { left: 150, bottom: 100 }, maxLayers: 8 }); + new InputHandler(this); + new LightsHandler(this, { enableLights: false }); + new DepthHelper(this); + new AnimatedTilemap(this, this.tilemap, this.tilemap.tilesets); } /* END-USER-CODE */ diff --git a/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts b/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts index 5f7c89b3..918b9443 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts @@ -64,7 +64,7 @@ export default class PreloadProbableWaffle extends Phaser.Scene { getMap(): MapType { // eslint-disable-next-line prefer-const - let mapId = 1; // todo get from somewhere else + let mapId = 2; // todo get from somewhere else switch (mapId) { case 1: return { diff --git a/apps/client/src/app/probable-waffle/game/world/const/game-config.ts b/apps/client/src/app/probable-waffle/game/world/const/game-config.ts index 620fb089..317d8b9e 100644 --- a/apps/client/src/app/probable-waffle/game/world/const/game-config.ts +++ b/apps/client/src/app/probable-waffle/game/world/const/game-config.ts @@ -4,11 +4,12 @@ import { baseGameConfig } from "../../../../shared/game/base-game.config"; import MapRiverCrossing from "../../scenes/MapRiverCrossing"; import PreloadProbableWaffle from "../../scenes/PreloadProbableWaffle"; import { Boot } from "../../scenes/Boot"; +import MapEmberEnclave from "../../scenes/MapEmberEnclave"; export const probableWaffleGameConfig: Types.Core.GameConfig = { ...baseGameConfig, // scene: [GrasslandScene, PlaygroundScene], - scene: [Boot, PreloadProbableWaffle, MapRiverCrossing], + scene: [Boot, PreloadProbableWaffle, MapRiverCrossing, MapEmberEnclave], physics: { default: "arcade", arcade: { diff --git a/apps/client/src/app/probable-waffle/game/world/managers/controllers/input/DEPRECATED_input.handler.ts b/apps/client/src/app/probable-waffle/game/world/managers/controllers/input/DEPRECATED_input.handler.ts new file mode 100644 index 00000000..d4844720 --- /dev/null +++ b/apps/client/src/app/probable-waffle/game/world/managers/controllers/input/DEPRECATED_input.handler.ts @@ -0,0 +1,182 @@ +import { Cameras, Geom, Input, Types } from "phaser"; + +export class DEPRECATED_inputHandler { + private readonly enabledMouseCornerMovement = false; + private readonly input: Input.InputPlugin; + private readonly mainCamera: Cameras.Scene2D.Camera; + private cursorOverGameInstance = false; + private keyboardMovementControls: Cameras.Controls.FixedKeyControl | null = null; + private readonly cameraEdgeMovementSpeed = 5; + private readonly cameraEdgeMargin = 30; + private readonly cameraMinZoom = 30; + private readonly cameraMaxZoom = 0.3; + private readonly recommendedZoom = 1; + private readonly cameraZoomFactor = 0.1; + + constructor(input: Input.InputPlugin, mainCamera: Cameras.Scene2D.Camera) { + this.input = input; + this.mainCamera = mainCamera; + this.createKeyboardControls(); + this.zoomListener(); + this.zoomToDefault(); + this.screenEdgeListener(); + } + + /** + * Detect if camera is out of bounds + */ + get isCameraOutOfBounds(): boolean { + // detect if camera is out of bounds + const cameraBounds = this.mainCamera.getBounds(); + const cameraWorldView = this.recalculateCameraWorldView(); + return ( + cameraWorldView.right > cameraBounds.right || + cameraWorldView.bottom > cameraBounds.bottom || + cameraWorldView.left < cameraBounds.left || + cameraWorldView.top < cameraBounds.top + ); + } + + update(time: number, delta: number) { + this.keyboardMovementControls?.update(delta); + this.screenEdgeMovementUpdate(); + } + + destroy() { + this.input.off(Input.Events.POINTER_WHEEL); + this.input.off(Input.Events.GAME_OUT); + this.input.off(Input.Events.GAME_OVER); + this.keyboardMovementControls?.destroy(); + } + + private createKeyboardControls() { + if (!this.input.keyboard) return; + const cursors = this.input.keyboard.createCursorKeys(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const wasdKeys = this.input.keyboard.addKeys({ + up: Input.Keyboard.KeyCodes.W, + left: Input.Keyboard.KeyCodes.A, + down: Input.Keyboard.KeyCodes.S, + right: Input.Keyboard.KeyCodes.D + }) satisfies Partial; + + // wasdKey can also be used here + const controlConfig: Types.Cameras.Controls.FixedKeyControlConfig = { + camera: this.mainCamera, + left: cursors.left, + right: cursors.right, + up: cursors.up, + down: cursors.down, + speed: 1 + }; + + this.keyboardMovementControls = new Cameras.Controls.FixedKeyControl(controlConfig); + } + + private screenEdgeMovementUpdate() { + if (!this.enabledMouseCornerMovement) return; + if (!this.cursorOverGameInstance) return; + + const pointer = this.input.activePointer; + if (pointer.x < this.cameraEdgeMargin) { + this.mainCamera.scrollX -= this.cameraEdgeMovementSpeed; + } + if (pointer.x > this.mainCamera.width - this.cameraEdgeMargin) { + this.mainCamera.scrollX += this.cameraEdgeMovementSpeed; + } + if (pointer.y < this.cameraEdgeMargin) { + this.mainCamera.scrollY -= this.cameraEdgeMovementSpeed; + } + if (pointer.y > this.mainCamera.height - this.cameraEdgeMargin) { + this.mainCamera.scrollY += this.cameraEdgeMovementSpeed; + } + } + + private zoomListener() { + this.input.on( + Input.Events.POINTER_WHEEL, + (pointer: Input.Pointer, gameObjects: unknown, deltaX: number, deltaY: number, deltaZ: number) => { + if (deltaY > 0) { + this.zoomOutByFactor(); + } + + if (deltaY < 0) { + // zoom in + const newZoom = this.mainCamera.zoom + this.cameraZoomFactor; + if (newZoom < this.cameraMinZoom) { + this.mainCamera.zoom = newZoom; + } + } + } + ); + } + + /** + * @returns {boolean} true if camera is zoomed out + */ + private zoomOutByFactor(): boolean { + const newZoom = this.mainCamera.zoom - this.cameraZoomFactor; + if (newZoom > this.cameraMaxZoom) { + this.mainCamera.zoom = newZoom; + } + + if (this.isCameraOutOfBounds) { + // if out of bounds, zoom back in + this.mainCamera.zoom += this.cameraZoomFactor; + return false; + } + return true; + } + + /** + * Zoom related + * So when the camera is zoomed out, we re-calc camera "worldView" so bounds can be checked. + * This worldView is recalculated in Phaser.Cameras.Scene2D.Camera#preRender, but that is too late. + * This is where the code is taken from. + */ + private recalculateCameraWorldView(): Geom.Rectangle { + const width = this.mainCamera.width; + const height = this.mainCamera.height; + + const halfWidth = width * 0.5; + const halfHeight = height * 0.5; + + const zoomX = this.mainCamera.zoomX; + const zoomY = this.mainCamera.zoomY; + + let sx = this.mainCamera.scrollX; + let sy = this.mainCamera.scrollY; + + if (this.mainCamera.useBounds) { + sx = this.mainCamera.clampX(sx); + sy = this.mainCamera.clampY(sy); + } + + const midX = sx + halfWidth; + const midY = sy + halfHeight; + + const displayWidth = width / zoomX; + const displayHeight = height / zoomY; + + return new Geom.Rectangle(midX - displayWidth / 2, midY - displayHeight / 2, displayWidth, displayHeight); + } + + private screenEdgeListener() { + this.input.on(Input.Events.GAME_OUT, () => { + this.cursorOverGameInstance = false; + }); + this.input.on(Input.Events.GAME_OVER, () => { + this.cursorOverGameInstance = true; + }); + } + + /** + * Zooms to recommended zoom. It ensures that camera doesn't go out of bounds + */ + private zoomToDefault() { + this.mainCamera.setZoom(this.cameraMinZoom); + while (this.mainCamera.zoom > this.recommendedZoom && this.zoomOutByFactor()) { + // zoom out until camera is out of bounds or we reached recommended zoom + } + } +} diff --git a/apps/client/src/app/probable-waffle/game/world/managers/controllers/input/input.handler.ts b/apps/client/src/app/probable-waffle/game/world/managers/controllers/input/input.handler.ts index e6fc2a7d..cfed7868 100644 --- a/apps/client/src/app/probable-waffle/game/world/managers/controllers/input/input.handler.ts +++ b/apps/client/src/app/probable-waffle/game/world/managers/controllers/input/input.handler.ts @@ -2,24 +2,36 @@ import { Cameras, Geom, Input, Types } from "phaser"; export class InputHandler { private readonly enabledMouseCornerMovement = false; + private readonly lockToScreen = false; // todo could be enabled later private readonly input: Input.InputPlugin; private readonly mainCamera: Cameras.Scene2D.Camera; private cursorOverGameInstance = false; private keyboardMovementControls: Cameras.Controls.FixedKeyControl | null = null; - private readonly cameraEdgeMovementSpeed = 5; private readonly cameraEdgeMargin = 30; private readonly cameraMinZoom = 30; private readonly cameraMaxZoom = 0.3; private readonly recommendedZoom = 1; private readonly cameraZoomFactor = 0.1; - constructor(input: Input.InputPlugin, mainCamera: Cameras.Scene2D.Camera) { - this.input = input; - this.mainCamera = mainCamera; + constructor( + private readonly scene: Phaser.Scene, + private readonly config: { + cameraEdgeMovementSpeed: number; + cameraKeyboardMovementSpeed: number; + } = { + cameraEdgeMovementSpeed: 5, + cameraKeyboardMovementSpeed: 2 + } + ) { + this.mainCamera = scene.cameras.main; + this.input = scene.input; this.createKeyboardControls(); this.zoomListener(); this.zoomToDefault(); this.screenEdgeListener(); + this.lockCursorToScreen(); + this.scene.events.on("update", this.update, this); + this.scene.events.on("shutdown", this.destroy, this); } /** @@ -43,9 +55,9 @@ export class InputHandler { } destroy() { - this.input.off(Input.Events.POINTER_WHEEL); this.input.off(Input.Events.GAME_OUT); this.input.off(Input.Events.GAME_OVER); + this.input.off(Input.Events.POINTER_WHEEL, this.zoomWithScrollHandler); this.keyboardMovementControls?.destroy(); } @@ -67,7 +79,7 @@ export class InputHandler { right: cursors.right, up: cursors.up, down: cursors.down, - speed: 1 + speed: this.config.cameraKeyboardMovementSpeed }; this.keyboardMovementControls = new Cameras.Controls.FixedKeyControl(controlConfig); @@ -79,36 +91,41 @@ export class InputHandler { const pointer = this.input.activePointer; if (pointer.x < this.cameraEdgeMargin) { - this.mainCamera.scrollX -= this.cameraEdgeMovementSpeed; + this.mainCamera.scrollX -= this.config.cameraEdgeMovementSpeed; } if (pointer.x > this.mainCamera.width - this.cameraEdgeMargin) { - this.mainCamera.scrollX += this.cameraEdgeMovementSpeed; + this.mainCamera.scrollX += this.config.cameraEdgeMovementSpeed; } if (pointer.y < this.cameraEdgeMargin) { - this.mainCamera.scrollY -= this.cameraEdgeMovementSpeed; + this.mainCamera.scrollY -= this.config.cameraEdgeMovementSpeed; } if (pointer.y > this.mainCamera.height - this.cameraEdgeMargin) { - this.mainCamera.scrollY += this.cameraEdgeMovementSpeed; + this.mainCamera.scrollY += this.config.cameraEdgeMovementSpeed; } } private zoomListener() { - this.input.on( - Input.Events.POINTER_WHEEL, - (pointer: Input.Pointer, gameObjects: unknown, deltaX: number, deltaY: number, deltaZ: number) => { - if (deltaY > 0) { - this.zoomOutByFactor(); - } + this.input.on(Input.Events.POINTER_WHEEL, this.zoomWithScrollHandler, this); + } - if (deltaY < 0) { - // zoom in - const newZoom = this.mainCamera.zoom + this.cameraZoomFactor; - if (newZoom < this.cameraMinZoom) { - this.mainCamera.zoom = newZoom; - } - } + private zoomWithScrollHandler( + pointer: Input.Pointer, + gameObjects: unknown, + deltaX: number, + deltaY: number, + deltaZ: number + ) { + if (deltaY > 0) { + this.zoomOutByFactor(); + } + + if (deltaY < 0) { + // zoom in + const newZoom = this.mainCamera.zoom + this.cameraZoomFactor; + if (newZoom < this.cameraMinZoom) { + this.mainCamera.zoom = newZoom; } - ); + } } /** @@ -179,4 +196,31 @@ export class InputHandler { // zoom out until camera is out of bounds or we reached recommended zoom } } + + /** + * https://phaser.io/examples/v3/view/input/mouse/pointer-lock + * https://web.dev/articles/pointerlock-intro + */ + private lockCursorToScreen() { + if (!this.lockToScreen) return; + if (this.input.keyboard && this.input.mouse) { + this.input.on("pointerdown", () => { + if (this.input.mouse && !this.input.mouse.locked) { + this.input.mouse?.requestPointerLock(); + } + }); + this.input.manager.events.on("pointerlockchange", (event: any) => { + const pointerIsLocked = this.input.mouse?.locked; + console.log("pointerIsLocked", pointerIsLocked); + }); + + // on esc, release pointer lock + this.input.keyboard.on("keydown_ESC", () => { + // todo maybe change this event + if (this.input.mouse?.locked) { + this.input.mouse.releasePointerLock(); + } + }); + } + } } diff --git a/apps/client/src/app/probable-waffle/game/world/map/DEPRECATED_scale.handler.ts b/apps/client/src/app/probable-waffle/game/world/map/DEPRECATED_scale.handler.ts new file mode 100644 index 00000000..8288e437 --- /dev/null +++ b/apps/client/src/app/probable-waffle/game/world/map/DEPRECATED_scale.handler.ts @@ -0,0 +1,47 @@ +import { MapDefinitions, MapSizeInfo } from "../const/map-size.info"; +import { Cameras, Scale, Structs } from "phaser"; + +export class DEPRECATED_scaleHandler { + private readonly mainCamera: Cameras.Scene2D.Camera; + private scaleManager: Scale.ScaleManager; + private cameras: Cameras.Scene2D.CameraManager; + + constructor(cameras: Cameras.Scene2D.CameraManager, scaleManager: Scale.ScaleManager) { + this.cameras = cameras; + this.mainCamera = cameras.main; + this.scaleManager = scaleManager; + this.setupBounds(true); // todo now center for dev + this.setupResizeListener(); + } + + setupResizeListener() { + this.scaleManager.on(Scale.Events.RESIZE, this.resize, this); + } + + setupBounds(centerOn: boolean = false) { + const xOffset = MapSizeInfo.info.tileWidthHalf; + const yOffset = MapSizeInfo.info.tileHeight; + + const layersOffsetY = MapSizeInfo.info.tileHeight * (MapDefinitions.nrLayers + 1); + + this.mainCamera.setBounds( + -MapSizeInfo.info.widthInPixels / 2 + xOffset, + yOffset - layersOffsetY, + MapSizeInfo.info.widthInPixels, + MapSizeInfo.info.heightInPixels + layersOffsetY, + centerOn + ); + } + + destroy() { + this.scaleManager.off(Scale.Events.RESIZE); + } + + /** + * * When the screen is resized + */ + private resize(gameSize: Structs.Size): void { + this.cameras.resize(gameSize.width, gameSize.height); + this.setupBounds(true); // todo now center for dev + } +} diff --git a/apps/client/src/app/probable-waffle/game/world/map/depth.helper.ts b/apps/client/src/app/probable-waffle/game/world/map/depth.helper.ts new file mode 100644 index 00000000..ca816195 --- /dev/null +++ b/apps/client/src/app/probable-waffle/game/world/map/depth.helper.ts @@ -0,0 +1,20 @@ +import ActorContainer from "../../entity/actor/ActorContainer"; + +export class DepthHelper { + constructor(private readonly scene: Phaser.Scene) { + this.handleSortOfStaticObjects(); + } + + private handleSortOfStaticObjects = () => { + const children = this.scene.children; + children.each((child: any) => { + if (!child.setDepth) return; + const childWithDepth = child as Phaser.GameObjects.Components.Depth; + childWithDepth.setDepth(child.y); + if (child instanceof ActorContainer) { + const z = child.z; + child.setDepth(child.y + z * 2); + } + }); + }; +} diff --git a/apps/client/src/app/probable-waffle/game/world/map/scale.handler.ts b/apps/client/src/app/probable-waffle/game/world/map/scale.handler.ts index e0b63445..6bb04254 100644 --- a/apps/client/src/app/probable-waffle/game/world/map/scale.handler.ts +++ b/apps/client/src/app/probable-waffle/game/world/map/scale.handler.ts @@ -1,15 +1,25 @@ -import { MapDefinitions, MapSizeInfo } from '../const/map-size.info'; -import { Cameras, Scale, Structs } from 'phaser'; +import { MapSizeInfo } from "../const/map-size.info"; +import { Cameras, Scale, Structs } from "phaser"; export class ScaleHandler { private readonly mainCamera: Cameras.Scene2D.Camera; private scaleManager: Scale.ScaleManager; private cameras: Cameras.Scene2D.CameraManager; - constructor(cameras: Cameras.Scene2D.CameraManager, scaleManager: Scale.ScaleManager) { - this.cameras = cameras; - this.mainCamera = cameras.main; - this.scaleManager = scaleManager; + constructor( + scene: Phaser.Scene, + private readonly tilemap: Phaser.Tilemaps.Tilemap, + private readonly config: { + margins: { + bottom: number; + left: number; + }; + maxLayers: number; + } + ) { + this.cameras = scene.cameras; + this.mainCamera = this.cameras.main; + this.scaleManager = scene.scale; this.setupBounds(true); // todo now center for dev this.setupResizeListener(); } @@ -19,18 +29,18 @@ export class ScaleHandler { } setupBounds(centerOn: boolean = false) { - const xOffset = MapSizeInfo.info.tileWidthHalf; - const yOffset = MapSizeInfo.info.tileHeight; - - const layersOffsetY = MapSizeInfo.info.tileHeight * (MapDefinitions.nrLayers + 1); - - this.mainCamera.setBounds( - -MapSizeInfo.info.widthInPixels / 2 + xOffset, - yOffset - layersOffsetY, - MapSizeInfo.info.widthInPixels, - MapSizeInfo.info.heightInPixels + layersOffsetY, - centerOn - ); + const maxMapLayers = this.config.maxLayers; + // noinspection UnnecessaryLocalVariableJS + const topMarginDueToMapLayers = maxMapLayers * MapSizeInfo.info.tileHeight; + const topMargin = topMarginDueToMapLayers; + const leftMargin = this.config.margins.left; + const bottomMargin = this.config.margins.bottom; + const mapLeft = -this.tilemap.widthInPixels / 2 - leftMargin; + const mapRight = +this.tilemap.widthInPixels / 2; + const mapTop = -topMargin; + const mapBottom = this.tilemap.heightInPixels + bottomMargin; + + this.mainCamera.setBounds(mapLeft, mapTop, mapRight - mapLeft, mapBottom - mapTop, centerOn); } destroy() { diff --git a/apps/client/src/app/probable-waffle/game/world/map/vision/lights.handler.ts b/apps/client/src/app/probable-waffle/game/world/map/vision/lights.handler.ts new file mode 100644 index 00000000..b7eb6471 --- /dev/null +++ b/apps/client/src/app/probable-waffle/game/world/map/vision/lights.handler.ts @@ -0,0 +1,62 @@ +import ActorContainer from "../../../entity/actor/ActorContainer"; + +export class LightsHandler { + private lights!: Phaser.GameObjects.LightsManager; + + constructor( + private readonly scene: Phaser.Scene, + config: { + enableLights: boolean; + } = { + enableLights: true + } + ) { + if (!config.enableLights) return; + this.lights = this.scene.lights; + + this.enableLights(); + this.moveLightToPointer(); + } + + enableLights = () => { + const children = this.scene.children; + + // add lights2d pipeline to all children + children.each((child: any) => { + if (child.setPipeline) { + child.setPipeline("Light2D"); + } + // if instanceOf ActorContainer, then add lights2d pipeline to all children of the container + if (child instanceof ActorContainer) { + child.each((child: any) => { + if (child.setPipeline) { + child.setPipeline("Light2D"); + } + }); + } + }); + + this.lights.enable(); + this.lights.setAmbientColor(0x808080); + }; + + moveLightToPointer = () => { + const spotlight = this.lights.addLight(0, 0, 280).setIntensity(2).setColor(0xffffff); + + const mainCamera = this.scene.cameras.main; + const input = this.scene.input; + + input.on("pointermove", (pointer: any) => { + const cameraX = mainCamera.scrollX; + const cameraY = mainCamera.scrollY; + const zoom = mainCamera.zoom; + + // Adjust the pointer position based on the inverse of the zoom + const adjustedPointerX = (pointer.x + cameraX) / zoom; + const adjustedPointerY = (pointer.y + cameraY) / zoom; + + spotlight.x = adjustedPointerX; + spotlight.y = adjustedPointerY; + }); + }; +} diff --git a/apps/client/src/app/probable-waffle/game/world/scenes/grassland.scene.ts b/apps/client/src/app/probable-waffle/game/world/scenes/grassland.scene.ts index 0fb25955..4b071d54 100644 --- a/apps/client/src/app/probable-waffle/game/world/scenes/grassland.scene.ts +++ b/apps/client/src/app/probable-waffle/game/world/scenes/grassland.scene.ts @@ -5,8 +5,8 @@ import { SceneCommunicatorService } from "../../../communicators/scene-communicator.service"; import { CreateSceneFromObjectConfig } from "../../../../shared/game/phaser/scene/scene-config.interface"; -import { InputHandler } from "../managers/controllers/input/input.handler"; -import { ScaleHandler } from "../map/scale.handler"; +import { DEPRECATED_inputHandler } from "../managers/controllers/input/DEPRECATED_input.handler"; +import { DEPRECATED_scaleHandler } from "../map/DEPRECATED_scale.handler"; import { MapDefinitions, TileDefinitions } from "../const/map-size.info"; import { CursorHandler } from "../managers/controllers/input/cursor.handler"; import { TilemapInputHandler, TilePlacementData } from "../managers/controllers/input/tilemap/tilemap-input.handler"; @@ -58,8 +58,8 @@ export interface TilemapToAtlasMap { } export class GrasslandScene extends Scene implements CreateSceneFromObjectConfig { - private inputHandler!: InputHandler; - private scaleHandler!: ScaleHandler; + private inputHandler!: DEPRECATED_inputHandler; + private scaleHandler!: DEPRECATED_scaleHandler; private cursorHandler!: CursorHandler; private tilemapInputHandler!: TilemapInputHandler; private manualTileInputHandler!: ManualTileInputHandler; @@ -177,8 +177,8 @@ export class GrasslandScene extends Scene implements CreateSceneFromObjectConfig this.dynamicObjectHelper.createDynamicObjectLayer(); // input handling - this.scaleHandler = new ScaleHandler(this.cameras, this.scale); - this.inputHandler = new InputHandler(this.input, this.cameras.main); + this.scaleHandler = new DEPRECATED_scaleHandler(this.cameras, this.scale); + this.inputHandler = new DEPRECATED_inputHandler(this.input, this.cameras.main); this.cursorHandler = new CursorHandler(this.input); this.tilemapInputHandler = new TilemapInputHandler(this.mapHelper.tilemapLayer); this.manualTileInputHandler = new ManualTileInputHandler(this, this.mapHelper.manualLayers); From 6accf97ecb6dd029966b791418f566b8c930dcc5 Mon Sep 17 00:00:00 2001 From: Jernej Habjan Date: Mon, 18 Dec 2023 19:08:15 +0100 Subject: [PATCH 005/138] Extend base scene --- .../src/app/probable-waffle/game/scenes/MapEmberEnclave.scene | 1 + .../src/app/probable-waffle/game/scenes/MapEmberEnclave.ts | 4 ++-- .../app/probable-waffle/game/scenes/MapRiverCrossing.scene | 1 + .../src/app/probable-waffle/game/scenes/MapRiverCrossing.ts | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene index 08ccc78b..505b802f 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene +++ b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene @@ -5,6 +5,7 @@ "snapEnabled": true, "exportClass": true, "autoImport": true, + "superClassName": "BaseScene", "preloadPackFiles": [], "createMethodName": "editorCreate", "sceneKey": "MapEmberEnclave", diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts index ad1f4104..efb19ef4 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts @@ -2,7 +2,6 @@ /* START OF COMPILED CODE */ -import Phaser from "phaser"; import BlockObsidianLava5 from "../prefabs/outside/nature/block_obsidian_lava/BlockObsidianLava5"; import BushDownwardsLarge from "../prefabs/outside/foliage/bushes/BushDownwardsLarge"; import BlockObsidianLava4 from "../prefabs/outside/nature/block_obsidian_lava/BlockObsidianLava4"; @@ -23,9 +22,10 @@ import { InputHandler } from "../world/managers/controllers/input/input.handler" import { LightsHandler } from "../world/map/vision/lights.handler"; import { DepthHelper } from "../world/map/depth.helper"; import { AnimatedTilemap } from "./AnimatedTile"; +import { BaseScene } from "../../../shared/game/phaser/scene/base.scene"; /* END-USER-IMPORTS */ -export default class MapEmberEnclave extends Phaser.Scene { +export default class MapEmberEnclave extends BaseScene { constructor() { super("MapEmberEnclave"); diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene index da6c421e..0144b417 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene @@ -5,6 +5,7 @@ "snapEnabled": true, "exportClass": true, "autoImport": true, + "superClassName": "BaseScene", "preloadPackFiles": [], "createMethodName": "editorCreate", "sceneKey": "MapRiverCrossing", diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts index 846279a2..a30916ea 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts @@ -2,7 +2,6 @@ /* START OF COMPILED CODE */ -import Phaser from "phaser"; import Tree7 from "../prefabs/outside/foliage/trees/resources/Tree7"; import Sandhold from "../prefabs/buildings/tivara/Sandhold"; import Owlery from "../prefabs/buildings/skaduwee/Owlery"; @@ -53,9 +52,10 @@ import { ScaleHandler } from "../world/map/scale.handler"; import { InputHandler } from "../world/managers/controllers/input/input.handler"; import { LightsHandler } from "../world/map/vision/lights.handler"; import { DepthHelper } from "../world/map/depth.helper"; +import { BaseScene } from "../../../shared/game/phaser/scene/base.scene"; /* END-USER-IMPORTS */ -export default class MapRiverCrossing extends Phaser.Scene { +export default class MapRiverCrossing extends BaseScene { constructor() { super("MapRiverCrossing"); From af0fca991de46aafc3e096330818ea167f2e1306 Mon Sep 17 00:00:00 2001 From: Jernej Habjan Date: Mon, 18 Dec 2023 20:25:27 +0100 Subject: [PATCH 006/138] Passing info to scene --- apps/client/src/app/app.module.ts | 34 +++++------ .../game/scenes/MapEmberEnclave.scene | 2 +- .../game/scenes/MapEmberEnclave.ts | 27 ++++++++- .../game/scenes/MapRiverCrossing.scene | 2 +- .../game/scenes/MapRiverCrossing.ts | 27 ++++++++- .../game/scenes/PreloadProbableWaffle.ts | 58 +++++++++++-------- .../probable-waffle-communicator.service.ts | 30 ++++++++++ .../game/scenes/probable-waffle-game-data.ts | 9 +++ .../gui/campaign/campaign.component.html | 2 +- .../gui/editor/editor.component.html | 20 ------- .../gui/editor/editor.component.scss | 20 ------- .../gui/editor/editor.component.spec.ts | 26 --------- .../gui/editor/editor.component.ts | 42 -------------- .../gui/game-interface/main/level.guard.ts | 21 +++++++ .../probable-waffle-game-routing.module.ts | 14 +++-- .../main/probable-waffle-game.component.ts | 25 +++++--- .../home-page-nav.component.html | 3 - .../main/probable-waffle-routing.module.ts | 43 ++++++-------- .../gui/main/probable-waffle.module.ts | 34 ++++++----- ...probable-waffle-coming-soon.component.html | 7 +++ ...probable-waffle-coming-soon.component.scss | 0 ...bable-waffle-coming-soon.component.spec.ts | 22 +++++++ .../probable-waffle-coming-soon.component.ts | 9 +++ libs/api-interfaces/src/fly-squasher.ts | 9 +++ libs/api-interfaces/src/game-instance.ts | 13 +++++ libs/api-interfaces/src/index.ts | 36 ++---------- .../fly-squasher/communicators.ts | 2 +- .../probable-waffle/communicators.ts | 13 +++++ .../src/lib/fly-squasher/fly-squasher.ts | 4 +- .../game-instance/fly-squasher/game-mode.ts | 4 +- .../lib/game-instance/probable-waffle/data.ts | 0 .../probable-waffle/game-instance-medatada.ts | 5 ++ .../probable-waffle/game-instance.ts | 52 +++++++++++++++++ .../probable-waffle/game-mode.ts | 13 +++++ .../probable-waffle/game-state.ts | 23 ++++++++ .../game-instance/probable-waffle/player.ts | 36 ++++++++++++ .../probable-waffle/spectator.ts | 9 +++ .../lib/probable-waffle/probable-waffle.ts | 33 +++++++++++ .../lib/user-info/fly-squasher/user-info.ts | 2 +- .../user-info/probable-waffle/user-info.ts | 3 + libs/api-interfaces/src/little-muncher.ts | 10 ++++ libs/api-interfaces/src/probable-waffle.ts | 9 +++ 42 files changed, 505 insertions(+), 248 deletions(-) create mode 100644 apps/client/src/app/probable-waffle/game/scenes/probable-waffle-communicator.service.ts create mode 100644 apps/client/src/app/probable-waffle/game/scenes/probable-waffle-game-data.ts delete mode 100644 apps/client/src/app/probable-waffle/gui/editor/editor.component.html delete mode 100644 apps/client/src/app/probable-waffle/gui/editor/editor.component.scss delete mode 100644 apps/client/src/app/probable-waffle/gui/editor/editor.component.spec.ts delete mode 100644 apps/client/src/app/probable-waffle/gui/editor/editor.component.ts create mode 100644 apps/client/src/app/probable-waffle/gui/game-interface/main/level.guard.ts create mode 100644 apps/client/src/app/probable-waffle/gui/probable-waffle-coming-soon/probable-waffle-coming-soon.component.html create mode 100644 apps/client/src/app/probable-waffle/gui/probable-waffle-coming-soon/probable-waffle-coming-soon.component.scss create mode 100644 apps/client/src/app/probable-waffle/gui/probable-waffle-coming-soon/probable-waffle-coming-soon.component.spec.ts create mode 100644 apps/client/src/app/probable-waffle/gui/probable-waffle-coming-soon/probable-waffle-coming-soon.component.ts create mode 100644 libs/api-interfaces/src/fly-squasher.ts create mode 100644 libs/api-interfaces/src/game-instance.ts create mode 100644 libs/api-interfaces/src/lib/communicators/probable-waffle/communicators.ts create mode 100644 libs/api-interfaces/src/lib/game-instance/probable-waffle/data.ts create mode 100644 libs/api-interfaces/src/lib/game-instance/probable-waffle/game-instance-medatada.ts create mode 100644 libs/api-interfaces/src/lib/game-instance/probable-waffle/game-instance.ts create mode 100644 libs/api-interfaces/src/lib/game-instance/probable-waffle/game-mode.ts create mode 100644 libs/api-interfaces/src/lib/game-instance/probable-waffle/game-state.ts create mode 100644 libs/api-interfaces/src/lib/game-instance/probable-waffle/player.ts create mode 100644 libs/api-interfaces/src/lib/game-instance/probable-waffle/spectator.ts create mode 100644 libs/api-interfaces/src/lib/probable-waffle/probable-waffle.ts create mode 100644 libs/api-interfaces/src/lib/user-info/probable-waffle/user-info.ts create mode 100644 libs/api-interfaces/src/little-muncher.ts create mode 100644 libs/api-interfaces/src/probable-waffle.ts diff --git a/apps/client/src/app/app.module.ts b/apps/client/src/app/app.module.ts index 5da24440..23b67832 100644 --- a/apps/client/src/app/app.module.ts +++ b/apps/client/src/app/app.module.ts @@ -1,18 +1,18 @@ -import { isDevMode, NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; -import { AppComponent } from './app.component'; -import { AppRoutingModule } from './app-routing.module'; -import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; -import { ServiceWorkerModule } from '@angular/service-worker'; -import { HomeModule } from './home/home.module'; -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { AuthGuard } from './auth/auth.guard'; -import { SocketIoModule } from 'ngx-socket-io'; -import { environment } from '../environments/environment'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { ComponentsModule } from './shared/components/components.module'; -import { AccessTokenInterceptor } from './auth/access-token.interceptor'; -import { LoaderComponent } from './shared/loader/loader.component'; +import { isDevMode, NgModule } from "@angular/core"; +import { BrowserModule } from "@angular/platform-browser"; +import { AppComponent } from "./app.component"; +import { AppRoutingModule } from "./app-routing.module"; +import { HTTP_INTERCEPTORS, HttpClientModule } from "@angular/common/http"; +import { ServiceWorkerModule } from "@angular/service-worker"; +import { HomeModule } from "./home/home.module"; +import { FontAwesomeModule } from "@fortawesome/angular-fontawesome"; +import { AuthGuard } from "./auth/auth.guard"; +import { SocketIoModule } from "ngx-socket-io"; +import { environment } from "../environments/environment"; +import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; +import { ComponentsModule } from "./shared/components/components.module"; +import { AccessTokenInterceptor } from "./auth/access-token.interceptor"; +import { LoaderComponent } from "./shared/loader/loader.component"; @NgModule({ declarations: [AppComponent], @@ -22,11 +22,11 @@ import { LoaderComponent } from './shared/loader/loader.component'; HomeModule, // app routing module must be included last, as it contains the wildcard route AppRoutingModule, - ServiceWorkerModule.register('ngsw-worker.js', { + ServiceWorkerModule.register("ngsw-worker.js", { enabled: !isDevMode(), // Register the ServiceWorker as soon as the application is stable // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000' + registrationStrategy: "registerWhenStable:30000" }), SocketIoModule.forRoot(environment.socketIoConfig), FontAwesomeModule, diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene index 505b802f..e071b241 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene +++ b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.scene @@ -5,7 +5,7 @@ "snapEnabled": true, "exportClass": true, "autoImport": true, - "superClassName": "BaseScene", + "superClassName": "BaseScene", "preloadPackFiles": [], "createMethodName": "editorCreate", "sceneKey": "MapEmberEnclave", diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts index efb19ef4..a2a2ee88 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/MapEmberEnclave.ts @@ -23,9 +23,32 @@ import { LightsHandler } from "../world/map/vision/lights.handler"; import { DepthHelper } from "../world/map/depth.helper"; import { AnimatedTilemap } from "./AnimatedTile"; import { BaseScene } from "../../../shared/game/phaser/scene/base.scene"; +import { ProbableWaffleGameData } from "./probable-waffle-game-data"; +import { + ProbableWaffleGameMode, + ProbableWaffleGameModeData, + ProbableWaffleGameState, + ProbableWaffleGameStateData, + ProbableWafflePlayer, + ProbableWafflePlayerControllerData, + ProbableWafflePlayerStateData, + ProbableWaffleSpectator, + ProbableWaffleSpectatorData +} from "@fuzzy-waddle/api-interfaces"; /* END-USER-IMPORTS */ -export default class MapEmberEnclave extends BaseScene { +export default class MapEmberEnclave extends BaseScene< + ProbableWaffleGameData, + ProbableWaffleGameStateData, + ProbableWaffleGameState, + ProbableWaffleGameModeData, + ProbableWaffleGameMode, + ProbableWafflePlayerStateData, + ProbableWafflePlayerControllerData, + ProbableWafflePlayer, + ProbableWaffleSpectatorData, + ProbableWaffleSpectator +> { constructor() { super("MapEmberEnclave"); @@ -125,6 +148,8 @@ export default class MapEmberEnclave extends BaseScene { new LightsHandler(this, { enableLights: false }); new DepthHelper(this); new AnimatedTilemap(this, this.tilemap, this.tilemap.tilesets); + + console.log("playing level", this.baseGameData.gameInstance.data.gameModeData!.level!.id); } /* END-USER-CODE */ diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene index 0144b417..fffacc0b 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.scene @@ -5,7 +5,7 @@ "snapEnabled": true, "exportClass": true, "autoImport": true, - "superClassName": "BaseScene", + "superClassName": "BaseScene", "preloadPackFiles": [], "createMethodName": "editorCreate", "sceneKey": "MapRiverCrossing", diff --git a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts index a30916ea..9d118a33 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/MapRiverCrossing.ts @@ -53,9 +53,32 @@ import { InputHandler } from "../world/managers/controllers/input/input.handler" import { LightsHandler } from "../world/map/vision/lights.handler"; import { DepthHelper } from "../world/map/depth.helper"; import { BaseScene } from "../../../shared/game/phaser/scene/base.scene"; +import { + ProbableWaffleGameMode, + ProbableWaffleGameModeData, + ProbableWaffleGameState, + ProbableWaffleGameStateData, + ProbableWafflePlayer, + ProbableWafflePlayerControllerData, + ProbableWafflePlayerStateData, + ProbableWaffleSpectator, + ProbableWaffleSpectatorData +} from "@fuzzy-waddle/api-interfaces"; +import { ProbableWaffleGameData } from "./probable-waffle-game-data"; /* END-USER-IMPORTS */ -export default class MapRiverCrossing extends BaseScene { +export default class MapRiverCrossing extends BaseScene< + ProbableWaffleGameData, + ProbableWaffleGameStateData, + ProbableWaffleGameState, + ProbableWaffleGameModeData, + ProbableWaffleGameMode, + ProbableWafflePlayerStateData, + ProbableWafflePlayerControllerData, + ProbableWafflePlayer, + ProbableWaffleSpectatorData, + ProbableWaffleSpectator +> { constructor() { super("MapRiverCrossing"); @@ -449,6 +472,8 @@ export default class MapRiverCrossing extends BaseScene { new LightsHandler(this, { enableLights: false }); new DepthHelper(this); new AnimatedTilemap(this, this.tilemap, this.tilemap.tilesets); + + console.log("playing level", this.baseGameData.gameInstance.data.gameModeData!.level!.id); } /* END-USER-CODE */ diff --git a/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts b/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts index 918b9443..25d02a4c 100644 --- a/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts +++ b/apps/client/src/app/probable-waffle/game/scenes/PreloadProbableWaffle.ts @@ -5,9 +5,36 @@ import Phaser from "phaser"; import PreloadBarUpdaterScript from "../../../other/Template/script-nodes/PreloadBarUpdaterScript"; /* START-USER-IMPORTS */ + +import { + ProbableWaffleGameMode, + ProbableWaffleGameModeData, + ProbableWaffleGameState, + ProbableWaffleGameStateData, + ProbableWaffleLevelEnum, + ProbableWaffleLevels, + ProbableWafflePlayer, + ProbableWafflePlayerControllerData, + ProbableWafflePlayerStateData, + ProbableWaffleSpectator, + ProbableWaffleSpectatorData +} from "@fuzzy-waddle/api-interfaces"; +import { BaseScene } from "../../../shared/game/phaser/scene/base.scene"; +import { ProbableWaffleGameData } from "./probable-waffle-game-data"; /* END-USER-IMPORTS */ -export default class PreloadProbableWaffle extends Phaser.Scene { +export default class PreloadProbableWaffle extends BaseScene< + ProbableWaffleGameData, + ProbableWaffleGameStateData, + ProbableWaffleGameState, + ProbableWaffleGameModeData, + ProbableWaffleGameMode, + ProbableWafflePlayerStateData, + ProbableWafflePlayerControllerData, + ProbableWafflePlayer, + ProbableWaffleSpectatorData, + ProbableWaffleSpectator +> { constructor() { super("PreloadProbableWaffle"); @@ -54,7 +81,7 @@ export default class PreloadProbableWaffle extends Phaser.Scene { this.load.pack("asset-pack", "assets/probable-waffle/asset-packers/asset-pack-probable-waffle.json"); const map = this.getMap(); - this.load.pack("asset-pack-map", map.assetPath); + this.load.pack("asset-pack-map", "assets/probable-waffle/asset-packers/maps/" + map.assetPath); } create() { @@ -62,33 +89,14 @@ export default class PreloadProbableWaffle extends Phaser.Scene { this.scene.start(map.sceneKey); } - getMap(): MapType { - // eslint-disable-next-line prefer-const - let mapId = 2; // todo get from somewhere else - switch (mapId) { - case 1: - return { - sceneKey: "MapRiverCrossing", - assetPath: "assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-river-crossing.json" - }; - case 2: - return { - sceneKey: "MapEmberEnclave", - assetPath: "assets/probable-waffle/asset-packers/maps/asset-pack-probable-waffle-ember-enclave.json" - }; - default: - throw new Error(`Map id ${mapId} not found`); - } + private getMap() { + const levelId = this.baseGameData.gameInstance.data.gameModeData!.level!.id; + const level = ProbableWaffleLevels[levelId]; + return level; } /* END-USER-CODE */ } - -type MapType = { - sceneKey: string; - assetPath: string; -}; - /* END OF COMPILED CODE */ // You can write more code here diff --git a/apps/client/src/app/probable-waffle/game/scenes/probable-waffle-communicator.service.ts b/apps/client/src/app/probable-waffle/game/scenes/probable-waffle-communicator.service.ts new file mode 100644 index 00000000..3d37faf5 --- /dev/null +++ b/apps/client/src/app/probable-waffle/game/scenes/probable-waffle-communicator.service.ts @@ -0,0 +1,30 @@ +import { Injectable, OnDestroy } from "@angular/core"; +import { ProbableWaffleCommunicatorScoreEvent, ProbableWaffleGatewayEvent } from "@fuzzy-waddle/api-interfaces"; +import { TwoWayCommunicator } from "../../../shared/game/communicators/two-way-communicator"; + +export const probableWaffleCommunicatorServiceStub = { + startCommunication: () => {}, + stopCommunication: () => {} +}; + +@Injectable({ + providedIn: "root" +}) +export class ProbableWaffleCommunicatorService implements OnDestroy { + score?: TwoWayCommunicator; + + startCommunication() { + this.score = new TwoWayCommunicator( + ProbableWaffleGatewayEvent.ProbableWaffleAction, + "score" + ); + } + + stopCommunication() { + this.score?.destroy(); + } + + ngOnDestroy(): void { + this.stopCommunication(); + } +} diff --git a/apps/client/src/app/probable-waffle/game/scenes/probable-waffle-game-data.ts b/apps/client/src/app/probable-waffle/game/scenes/probable-waffle-game-data.ts new file mode 100644 index 00000000..6ebf971e --- /dev/null +++ b/apps/client/src/app/probable-waffle/game/scenes/probable-waffle-game-data.ts @@ -0,0 +1,9 @@ +import { ProbableWaffleGameInstance, ProbableWaffleUserInfo } from "@fuzzy-waddle/api-interfaces"; +import { ProbableWaffleCommunicatorService } from "./probable-waffle-communicator.service"; +import { BaseGameData } from "../../../shared/game/phaser/game/base-game-data"; + +export type ProbableWaffleGameData = BaseGameData< + ProbableWaffleCommunicatorService, + ProbableWaffleGameInstance, + ProbableWaffleUserInfo +>; diff --git a/apps/client/src/app/probable-waffle/gui/campaign/campaign.component.html b/apps/client/src/app/probable-waffle/gui/campaign/campaign.component.html index 2c598ce2..e3f2484e 100644 --- a/apps/client/src/app/probable-waffle/gui/campaign/campaign.component.html +++ b/apps/client/src/app/probable-waffle/gui/campaign/campaign.component.html @@ -1,2 +1,2 @@ -
Campaign
+ diff --git a/apps/client/src/app/probable-waffle/gui/editor/editor.component.html b/apps/client/src/app/probable-waffle/gui/editor/editor.component.html deleted file mode 100644 index 1df4506b..00000000 --- a/apps/client/src/app/probable-waffle/gui/editor/editor.component.html +++ /dev/null @@ -1,20 +0,0 @@ - -
-
-
Create a new map
- -
- -
-
-
-
Load your map
-
-
-
{{ map.name }}
- map preview - -
-
-
-
diff --git a/apps/client/src/app/probable-waffle/gui/editor/editor.component.scss b/apps/client/src/app/probable-waffle/gui/editor/editor.component.scss deleted file mode 100644 index 4de1cf49..00000000 --- a/apps/client/src/app/probable-waffle/gui/editor/editor.component.scss +++ /dev/null @@ -1,20 +0,0 @@ -@import '../../../../styles/_variables.scss'; - -:host { - display: flex; - flex-direction: column; - width: 100%; - height: 100%; - background-color: $tertiary; -} - -.editor { - display: flex; - margin-left: auto; - margin-right: auto; - - .map-tile { - border-radius: 10px; - border: 2px solid $primary; - } -} diff --git a/apps/client/src/app/probable-waffle/gui/editor/editor.component.spec.ts b/apps/client/src/app/probable-waffle/gui/editor/editor.component.spec.ts deleted file mode 100644 index 785275fe..00000000 --- a/apps/client/src/app/probable-waffle/gui/editor/editor.component.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { EditorComponent } from './editor.component'; -import { provideRouter } from '@angular/router'; -import { MapSelectorTestingComponent } from '../skirmish/map-selector/map-selector.component.spec'; -import { HomeNavTestingComponent } from '../../../shared/components/home-nav/home-nav.component.spec'; - -describe('EditorComponent', () => { - let component: EditorComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [EditorComponent, MapSelectorTestingComponent, HomeNavTestingComponent], - providers: [provideRouter([])] - }).compileComponents(); - - fixture = TestBed.createComponent(EditorComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/apps/client/src/app/probable-waffle/gui/editor/editor.component.ts b/apps/client/src/app/probable-waffle/gui/editor/editor.component.ts deleted file mode 100644 index 87561979..00000000 --- a/apps/client/src/app/probable-waffle/gui/editor/editor.component.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Component } from '@angular/core'; -import { MapIds } from '../../game/world/scenes/scenes'; -import { MapPlayerDefinition } from '../skirmish/skirmish.component'; -import { Router } from '@angular/router'; - -type EditorMap = { name: string; id: MapIds; imageSrc?: string }; - -@Component({ - selector: 'fuzzy-waddle-editor', - templateUrl: './editor.component.html', - styleUrls: ['./editor.component.scss'] -}) -export class EditorComponent { - constructor(private readonly router: Router) {} - - maps: EditorMap[] = [ - { name: 'Grassland Small', id: MapIds.GrasslandSmall, imageSrc: 'assets/probable-waffle/tilemaps/start-small.png' }, - { name: 'Grassland Large', id: MapIds.GrasslandLarge, imageSrc: 'assets/probable-waffle/tilemaps/start-large.png' }, - { - name: 'Grassland Extra Large', - id: MapIds.GrasslandExtraLarge, - imageSrc: 'assets/probable-waffle/tilemaps/start-extra-large.png' - }, - { - name: 'Grassland Extra Extra Large', - id: MapIds.GrasslandExtraLarge, - imageSrc: 'assets/probable-waffle/tilemaps/start-extra-extra-large.png' - } - ]; - - loadMap(map: EditorMap) { - // todo - } - - startMap($event: MapPlayerDefinition) { - // todo - } - - leave() { - this.router.navigate(['/probable-waffle']); - } -} diff --git a/apps/client/src/app/probable-waffle/gui/game-interface/main/level.guard.ts b/apps/client/src/app/probable-waffle/gui/game-interface/main/level.guard.ts new file mode 100644 index 00000000..3f4c4477 --- /dev/null +++ b/apps/client/src/app/probable-waffle/gui/game-interface/main/level.guard.ts @@ -0,0 +1,21 @@ +import { Injectable } from "@angular/core"; +import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from "@angular/router"; + +@Injectable({ + providedIn: "root" +}) +export class LevelGuard implements CanActivate { + constructor(private router: Router) {} + + canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { + const level = true; // todo read this from service instead from route + if (level) { + // Level exists, allow navigation + return true; + } else { + // Level doesn't exist, redirect to a fallback route or show an error page + this.router.navigate(["/probable-waffle"]); + return false; + } + } +} diff --git a/apps/client/src/app/probable-waffle/gui/game-interface/main/probable-waffle-game-routing.module.ts b/apps/client/src/app/probable-waffle/gui/game-interface/main/probable-waffle-game-routing.module.ts index 5c8a14ef..4cef2a4e 100644 --- a/apps/client/src/app/probable-waffle/gui/game-interface/main/probable-waffle-game-routing.module.ts +++ b/apps/client/src/app/probable-waffle/gui/game-interface/main/probable-waffle-game-routing.module.ts @@ -1,13 +1,15 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { ProbableWaffleGameComponent } from './probable-waffle-game.component'; +import { NgModule } from "@angular/core"; +import { RouterModule, Routes } from "@angular/router"; +import { ProbableWaffleGameComponent } from "./probable-waffle-game.component"; +import { LevelGuard } from "./level.guard"; const routes: Routes = [ { - path: '', - component: ProbableWaffleGameComponent + path: "", + component: ProbableWaffleGameComponent, + canActivate: [LevelGuard] }, - { path: '**', redirectTo: '/' } + { path: "**", redirectTo: "/probable-waffle" } ]; @NgModule({ diff --git a/apps/client/src/app/probable-waffle/gui/game-interface/main/probable-waffle-game.component.ts b/apps/client/src/app/probable-waffle/gui/game-interface/main/probable-waffle-game.component.ts index 80b89155..c4abb1d0 100644 --- a/apps/client/src/app/probable-waffle/gui/game-interface/main/probable-waffle-game.component.ts +++ b/apps/client/src/app/probable-waffle/gui/game-interface/main/probable-waffle-game.component.ts @@ -1,10 +1,15 @@ -import { Component, OnDestroy, OnInit } from "@angular/core"; +import { Component, Input, OnDestroy, OnInit } from "@angular/core"; import { SceneCommunicatorService } from "../../../communicators/scene-communicator.service"; import { probableWaffleGameConfig } from "../../../game/world/const/game-config"; import { BaseGameData } from "../../../../shared/game/phaser/game/base-game-data"; -import { LittleMuncherGameInstance, LittleMuncherUserInfo } from "@fuzzy-waddle/api-interfaces"; -import { LittleMuncherCommunicatorService } from "../../../../little-muncher/game/little-muncher-communicator.service"; +import { + ProbableWaffleGameInstance, + ProbableWaffleLevelEnum, + ProbableWaffleLevels, + ProbableWaffleUserInfo +} from "@fuzzy-waddle/api-interfaces"; import { AuthService } from "../../../../auth/auth.service"; +import { ProbableWaffleCommunicatorService } from "../../../game/scenes/probable-waffle-communicator.service"; @Component({ selector: "fuzzy-waddle-game", @@ -15,10 +20,10 @@ export class ProbableWaffleGameComponent implements OnInit, OnDestroy { protected readonly probableWaffleGameConfig = probableWaffleGameConfig; drawerWidth = "150px"; displayDrawers = true; // todo - gameData?: BaseGameData; // todo + gameData?: BaseGameData; constructor( - private readonly communicatorService: LittleMuncherCommunicatorService, + private readonly communicatorService: ProbableWaffleCommunicatorService, private readonly authService: AuthService ) {} @@ -28,12 +33,16 @@ export class ProbableWaffleGameComponent implements OnInit, OnDestroy { ngOnInit(): void { SceneCommunicatorService.setup(); - const gameSessionInstance = new LittleMuncherGameInstance(); // todo later use ProbableWaffleGameInstance + const gameSessionInstance = new ProbableWaffleGameInstance({ + gameModeData: { + level: ProbableWaffleLevels[ProbableWaffleLevelEnum.EmberEnclave] // todo read this from ID + } + }); this.gameData = { gameInstance: gameSessionInstance, communicator: this.communicatorService, - user: new LittleMuncherUserInfo(this.authService.userId) // todo later use ProbableWaffleUserInfo - }; + user: new ProbableWaffleUserInfo(this.authService.userId) + } as const; // todo properly listen with communicatorService diff --git a/apps/client/src/app/probable-waffle/gui/home/home-page-nav/home-page-nav.component.html b/apps/client/src/app/probable-waffle/gui/home/home-page-nav/home-page-nav.component.html index bc82842b..e2cdcf97 100644 --- a/apps/client/src/app/probable-waffle/gui/home/home-page-nav/home-page-nav.component.html +++ b/apps/client/src/app/probable-waffle/gui/home/home-page-nav/home-page-nav.component.html @@ -9,9 +9,6 @@ -