diff --git a/public/TiledTDThree64.png b/public/TiledTDThree64.png new file mode 100644 index 0000000..2abadf3 Binary files /dev/null and b/public/TiledTDThree64.png differ diff --git a/public/Tileset.tsx b/public/Tileset.tsx index f5b0984..f109f67 100644 --- a/public/Tileset.tsx +++ b/public/Tileset.tsx @@ -1,4 +1,4 @@ - + diff --git a/public/assets/maps/07_final_stretch.png b/public/assets/maps/07_final_stretch.png new file mode 100644 index 0000000..0bd3bc9 Binary files /dev/null and b/public/assets/maps/07_final_stretch.png differ diff --git a/public/assets/maps/mission_01.png b/public/assets/maps/mission_01.png deleted file mode 100644 index cd31cf8..0000000 Binary files a/public/assets/maps/mission_01.png and /dev/null differ diff --git a/public/assets/missions/01_first_steps.json b/public/assets/missions/01_first_steps.json index 6ace830..2fe6e66 100644 --- a/public/assets/missions/01_first_steps.json +++ b/public/assets/missions/01_first_steps.json @@ -28,31 +28,31 @@ ], "paths": [ [ - [8, 0], - [8, 1], - [8, 2], - [8, 3], - [8, 4], - [8, 5], - [8, 6], - [8, 7], + [0, 8], + [1, 8], + [2, 8], + [3, 8], + [4, 8], + [5, 8], + [6, 8], + [7, 8], [8, 8], - [8, 9], - [8, 10], - [8, 11], - [8, 12], - [8, 13], - [8, 14], - [8, 15], - [8, 16], - [8, 17], - [8, 18], - [8, 19], - [8, 20], - [8, 21], - [8, 22], - [8, 23], - [8, 24] + [9, 8], + [10, 8], + [11, 8], + [12, 8], + [13, 8], + [14, 8], + [15, 8], + [16, 8], + [17, 8], + [18, 8], + [19, 8], + [20, 8], + [21, 8], + [22, 8], + [23, 8], + [24, 8] ] ] }, diff --git a/public/assets/missions/02_the_turn.json b/public/assets/missions/02_the_turn.json index 19fcf1a..f0e8e6b 100644 --- a/public/assets/missions/02_the_turn.json +++ b/public/assets/missions/02_the_turn.json @@ -1,6 +1,6 @@ { "name": "The Turn", - "description": "A winding path presents new defensive challenges. Watch out for quick enemies!", + "description": "Start using some better strategies for this one.", "mapImage": { "url": "/assets/maps/02_the_turn.png" }, @@ -41,17 +41,40 @@ [10, 4], [11, 4], [12, 4], - [11, 6], - [11, 7], - [11, 8], - [11, 9], + [12, 5], + [12, 6], + [12, 7], + [12, 8], + [12, 9], + [12, 10], [11, 10], - [11, 11], - [2, 10], - [2, 11], - [2, 12], - [2, 13], - [2, 14], + [10, 10], + [9, 10], + [8, 10], + [7, 10], + [6, 10], + [5, 10], + [4, 10], + [3, 10], + [3, 11], + [3, 12], + [3, 13], + [3, 14], + [4, 14], + [5, 14], + [6, 14], + [7, 14], + [8, 14], + [9, 14], + [10, 14], + [11, 14], + [12, 14], + [13, 14], + [14, 14], + [15, 14], + [16, 14], + [17, 14], + [18, 14], [19, 14], [20, 14], [20, 13], @@ -63,7 +86,10 @@ [20, 7], [20, 6], [20, 5], - [20, 4] + [21, 5], + [22, 5], + [23, 5], + [24, 5] ] ] }, @@ -73,30 +99,30 @@ { "firstCreepSpawnTick": 500, "spawnIntervalTicks": 1000, - "creeps": [0, 0, 0, 0] - }, - { - "firstCreepSpawnTick": 5000, - "spawnIntervalTicks": 800, - "creeps": [1, 1, 1] + "creeps": [0, 0, 0, 0, 0] } ], - "offeredGems": [0, 1] + "offeredGems": [0, 0, 0, 0] }, { "waves": [ { "firstCreepSpawnTick": 500, - "spawnIntervalTicks": 800, - "creeps": [0, 1, 0, 1, 0] - }, - { - "firstCreepSpawnTick": 5000, - "spawnIntervalTicks": 600, - "creeps": [1, 1, 1, 1] + "spawnIntervalTicks": 1000, + "creeps": [1, 1, 1, 1, 1] } ], - "offeredGems": [0, 1, 2] + "offeredGems": [0, 1, 2, 3] + }, + { + "waves": [ + { + "firstCreepSpawnTick": 500, + "spawnIntervalTicks": 1000, + "creeps": [2, 2, 2, 2, 2] + } + ], + "offeredGems": [0, 1, 2, 3] } ] } diff --git a/public/assets/missions/03_fork_in_the_road.json b/public/assets/missions/03_fork_in_the_road.json index ff4b9e7..46bf5b8 100644 --- a/public/assets/missions/03_fork_in_the_road.json +++ b/public/assets/missions/03_fork_in_the_road.json @@ -28,66 +28,66 @@ ], "paths": [ [ - [8, 0], - [8, 1], - [8, 2], - [8, 3], - [8, 4], - [8, 5], - [8, 6], - [8, 7], - [8, 8], - [7, 8], - [6, 8], - [5, 8], + [0, 8], + [1, 8], + [2, 8], + [3, 8], [4, 8], - [4, 9], - [4, 10], - [4, 11], - [4, 12], - [4, 13], - [4, 14], - [4, 15], - [4, 16], - [4, 17], - [4, 18], - [4, 19], - [4, 20], - [4, 21], - [4, 22], - [4, 23], - [4, 24] + [5, 8], + [6, 8], + [7, 8], + [8, 8], + [8, 7], + [8, 6], + [8, 5], + [8, 4], + [9, 4], + [10, 4], + [11, 4], + [12, 4], + [13, 4], + [14, 4], + [15, 4], + [16, 4], + [17, 4], + [18, 4], + [19, 4], + [20, 4], + [21, 4], + [22, 4], + [23, 4], + [24, 4] ], [ - [8, 0], - [8, 1], - [8, 2], - [8, 3], - [8, 4], - [8, 5], - [8, 6], - [8, 7], + [0, 8], + [1, 8], + [2, 8], + [3, 8], + [4, 8], + [5, 8], + [6, 8], + [7, 8], [8, 8], - [9, 8], - [10, 8], - [11, 8], - [12, 8], - [12, 9], - [12, 10], - [12, 11], + [8, 9], + [8, 10], + [8, 11], + [8, 12], + [9, 12], + [10, 12], + [11, 12], [12, 12], - [12, 13], - [12, 14], - [12, 15], - [12, 16], - [12, 17], - [12, 18], - [12, 19], - [12, 20], - [12, 21], - [12, 22], - [12, 23], - [12, 24] + [13, 12], + [14, 12], + [15, 12], + [16, 12], + [17, 12], + [18, 12], + [19, 12], + [20, 12], + [21, 12], + [22, 12], + [23, 12], + [24, 12] ] ] }, diff --git a/public/assets/missions/mission_01.json b/public/assets/missions/mission_01.json deleted file mode 100644 index a997e15..0000000 --- a/public/assets/missions/mission_01.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "name": "Mission 1", - "description": "This is the first mission", - "mapImage": { - "url": "/assets/maps/mission_01.png" - }, - "gameMap": { - "rows": 17, - "columns": 25, - "cells": [ - [1, 1, 1, 1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, 1, 1, 1, 1, 1, 1, 1, 1, 1], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] - ], - "paths": [ - [ - [0, 4], - [1, 4], - [2, 4], - [3, 4], - [4, 4], - [5, 4], - [6, 4], - [7, 4], - [8, 4], - [9, 4], - [10, 4], - [11, 4], - [12, 4], - [12, 5], - [12, 6], - [12, 7], - [12, 8], - [12, 9], - [12, 10], - [11, 10], - [10, 10], - [9, 10], - [8, 10], - [7, 10], - [6, 10], - [5, 10], - [4, 10], - [3, 10], - [3, 11], - [3, 12], - [3, 13], - [3, 14], - [4, 14], - [5, 14], - [6, 14], - [7, 14], - [8, 14], - [9, 14], - [10, 14], - [11, 14], - [12, 14], - [13, 14], - [14, 14], - [15, 14], - [16, 14], - [17, 14], - [18, 14], - [19, 14], - [20, 14], - [20, 13], - [20, 12], - [20, 11], - [20, 10], - [20, 9], - [20, 8], - [20, 7], - [20, 6], - [20, 5], - [21, 5], - [22, 5], - [23, 5], - [24, 5] - ] - ] - }, - "rounds": [ - { - "waves": [ - { - "firstCreepSpawnTick": 500, - "spawnIntervalTicks": 1000, - "creeps": [0, 0, 0, 0, 0] - } - ], - "offeredGems": [0, 0, 0, 0] - }, - { - "waves": [ - { - "firstCreepSpawnTick": 500, - "spawnIntervalTicks": 1000, - "creeps": [1, 1, 1, 1, 1] - } - ], - "offeredGems": [0, 1, 2, 3] - }, - { - "waves": [ - { - "firstCreepSpawnTick": 500, - "spawnIntervalTicks": 1000, - "creeps": [2, 2, 2, 2, 2] - } - ], - "offeredGems": [0, 1, 2, 3] - } - ] -} diff --git a/public/maps.tiled-session b/public/maps.tiled-session index 1407999..404fdbb 100644 --- a/public/maps.tiled-session +++ b/public/maps.tiled-session @@ -55,51 +55,51 @@ } }, "tiled/01_first_steps.tmx": { - "scale": 0.75, + "scale": 0.33, "selectedLayer": 0, "viewCenter": { - "x": 800.6666666666665, - "y": 543.3333333333333 + "x": 639.3939393939394, + "y": 433.33333333333326 } }, "tiled/02_the_turn.tmx": { - "scale": 1, + "scale": 0.33, "selectedLayer": 0, "viewCenter": { - "x": 800.5, - "y": 543.5 + "x": 869.6969696969697, + "y": 203.03030303030323 } }, "tiled/03_fork_in_the_road.tmx": { - "scale": 1, + "scale": 0.33, "selectedLayer": 0, "viewCenter": { - "x": 800.5, - "y": 543.5 + "x": 2693.9393939393935, + "y": 239.3939393939395 } }, "tiled/04_crossroads.tmx": { "scale": 1, "selectedLayer": 0, "viewCenter": { - "x": 800.5, - "y": 543.5 + "x": 646.5, + "y": 543 } }, "tiled/05_the_maze.tmx": { - "scale": 1.6494375, + "scale": 0.5, "selectedLayer": 0, "viewCenter": { - "x": 799.9696866355955, - "y": 544.1248910613467 + "x": 896, + "y": 406 } }, "tiled/06_multiple_fronts.tmx": { - "scale": 1.6494375, + "scale": 0.75, "selectedLayer": 0, "viewCenter": { - "x": 799.9696866355955, - "y": 544.1248910613467 + "x": 873.3333333333333, + "y": 474.6666666666666 } }, "tiled/Mission01.tmx": { @@ -107,7 +107,7 @@ "selectedLayer": 0, "viewCenter": { "x": 833, - "y": 628.5 + "y": 629 } } }, @@ -115,7 +115,7 @@ "last.externalTilesetPath": "/home/koneko/Programing/js/towerdefense/public", "map.height": 17, "map.lastUsedExportFilter": "All Files (*)", - "map.lastUsedFormat": "json", + "map.lastUsedFormat": "tmx", "map.tileHeight": 64, "map.tileWidth": 64, "map.width": 25, @@ -130,13 +130,13 @@ ], "project": "maps.tiled-project", "recentFiles": [ + "tiled/Mission01.tmx", "tiled/04_crossroads.tmx", "tiled/05_the_maze.tmx", "tiled/06_multiple_fronts.tmx", "tiled/03_fork_in_the_road.tmx", "tiled/02_the_turn.tmx", "tiled/01_first_steps.tmx", - "tiled/Mission01.tmx", "tiled/01_first_steps..tmx", "Mission011.tmx", "Tileset.tsx", diff --git a/public/tiled/06_multiple_fronts.tmx b/public/tiled/06_multiple_fronts.tmx index f93c5c1..11fee87 100644 --- a/public/tiled/06_multiple_fronts.tmx +++ b/public/tiled/06_multiple_fronts.tmx @@ -1,5 +1,5 @@ - + @@ -7,10 +7,10 @@ 15,3,4,4,21,18,19,15,15,15,15,15,3,4,4,4,4,4,4,4,4,4,5,15,15, 15,17,18,18,18,18,19,15,15,15,15,15,17,18,18,18,18,18,18,18,18,18,19,15,15, 15,17,18,6,32,32,33,15,15,15,15,15,17,18,6,32,32,32,32,32,7,18,19,15,15, -15,17,18,20,4,4,4,4,4,4,4,4,21,18,19,15,15,15,15,15,17,18,20,4,4, -15,17,18,18,18,18,18,18,18,18,18,18,18,18,19,15,15,15,15,15,17,18,18,18,18, -15,31,32,32,32,32,32,32,32,32,32,32,32,32,33,15,15,15,15,15,31,32,32,32,32, -15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, +15,17,18,19,15,15,15,15,15,15,15,15,17,18,19,15,15,15,15,15,17,18,20,4,4, +15,17,18,20,4,4,4,4,4,4,4,4,21,18,19,15,15,15,15,15,17,18,18,18,18, +15,17,18,18,18,18,18,18,18,18,18,18,18,18,19,15,15,15,15,15,31,32,32,32,32, +15,31,32,32,32,32,32,32,32,32,32,32,32,32,33,15,15,15,15,15,15,15,15,15,15, 4,4,4,5,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, 18,18,18,19,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, 32,7,18,19,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, diff --git a/public/tiled/07_final_stretch.tmx b/public/tiled/07_final_stretch.tmx new file mode 100644 index 0000000..d61ba2e --- /dev/null +++ b/public/tiled/07_final_stretch.tmx @@ -0,0 +1,25 @@ + + + + + +15,17,18,19,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,17,18,19,15, +15,17,18,19,15,3,4,4,4,4,4,5,15,3,4,4,4,4,4,5,15,17,18,19,15, +15,17,18,19,15,17,18,18,18,18,18,19,15,17,18,18,18,18,18,19,15,17,18,19,15, +15,17,18,19,15,17,18,6,32,7,18,19,15,17,18,6,32,7,18,19,15,17,18,19,15, +15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15, +15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15, +15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15, +15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15, +15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15, +15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15, +15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15, +15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15, +15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15,17,18,19,15, +15,17,18,20,4,21,18,19,15,17,18,20,4,21,18,19,15,17,18,20,4,21,18,19,15, +15,17,18,18,18,18,18,19,15,17,18,18,18,18,18,19,15,17,18,18,18,18,18,19,15, +15,31,32,32,32,32,32,33,15,31,32,32,32,32,32,33,15,31,32,32,32,32,32,33,15, +15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 + + + diff --git a/public/tiled/Mission01.tmx b/public/tiled/Mission01.tmx deleted file mode 100644 index 17914fa..0000000 --- a/public/tiled/Mission01.tmx +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, -15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, -15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, -4,4,4,4,4,4,4,4,4,4,4,4,4,5,15,15,15,15,15,15,15,15,15,15,15, -18,18,18,18,18,18,18,18,18,18,18,18,18,19,15,15,15,15,15,3,4,4,4,4,4, -32,32,32,32,32,32,32,32,32,32,32,7,18,19,15,15,15,15,15,17,18,18,18,18,18, -15,15,15,15,15,15,15,15,15,15,15,17,18,19,15,15,15,15,15,17,18,6,32,32,32, -15,15,15,15,15,15,15,15,15,15,15,17,18,19,15,15,15,15,15,17,18,19,15,15,15, -15,15,15,15,15,15,15,15,15,15,15,17,18,19,15,15,15,15,15,17,18,19,15,15,15, -15,15,3,4,4,4,4,4,4,4,4,21,18,19,15,15,15,15,15,17,18,19,15,15,15, -15,15,17,18,18,18,18,18,18,18,18,18,18,19,15,15,15,15,15,17,18,19,15,15,15, -15,15,17,18,6,32,32,32,32,32,32,32,32,33,15,15,15,15,15,17,18,19,15,15,15, -15,15,17,18,19,15,15,15,15,15,15,15,15,15,15,15,15,15,15,17,18,19,15,15,15, -15,15,17,18,20,4,4,4,4,4,4,4,4,4,4,4,4,4,4,21,18,19,15,15,15, -15,15,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,15,15,15, -15,15,31,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,33,15,15,15, -15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 - - - diff --git a/src/classes/Assets.ts b/src/classes/Assets.ts index 1abebbf..c25519b 100644 --- a/src/classes/Assets.ts +++ b/src/classes/Assets.ts @@ -152,7 +152,6 @@ export default class GameAssets { private static async LoadMissions() { // When adding missions, make sure to keep order. - await this.LoadMission('./assets/missions/mission_01.json'); await this.LoadMission('./assets/missions/01_first_steps.json'); await this.LoadMission('./assets/missions/02_the_turn.json'); await this.LoadMission('./assets/missions/03_fork_in_the_road.json'); diff --git a/src/classes/Bastion.ts b/src/classes/Bastion.ts index 9a9f95d..b8fc872 100644 --- a/src/classes/Bastion.ts +++ b/src/classes/Bastion.ts @@ -30,6 +30,9 @@ export class Engine { public static MouseY: number = 0; public static TestSuite() { + let params = new URLSearchParams(location.href); + if (params.entries().next().value[1] != 'game') return; + Engine.NotificationManager.Notify('Loaded testing suite.', 'danger'); Engine.TowerManager.ToggleChoosingTowerLocation('RESET'); Engine.TowerManager.PlaceTower(GameAssets.Towers[1], 8, 10, GameAssets.Towers[0].behaviour, true); diff --git a/src/classes/game/Grid.ts b/src/classes/game/Grid.ts index d7b8a0c..dd3c1a4 100644 --- a/src/classes/game/Grid.ts +++ b/src/classes/game/Grid.ts @@ -66,6 +66,27 @@ export class Cell extends GameObject { this.hasTowerPlaced = false; } }); + + // Disable this if you want to add new maps. + // if(true) return; + const text = new PIXI.Text({ + text: `${this.column}|${this.row}`, + style: new PIXI.TextStyle({ + fill: 0xffffff, + stroke: { + color: 0x000000, + width: 2, + }, + }), + }); + this.container.addChild(text); + text.anchor.set(0.5, 0.5); + text.x = this.bb.width / 2; + text.y = this.bb.height / 2; + if (isPath) { + text.style.fill = 'pink'; + text.style.fontWeight = 'bold'; + } } public showRangePreview(invalid, range) { let color = 0xffffff; diff --git a/src/main.ts b/src/main.ts index 7b6a584..dcb047e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -64,7 +64,7 @@ import KeyboardManager from './classes/game/KeyboardManager'; }); Engine.GameMaster.changeScene(new MainScene()); let params = new URLSearchParams(location.href); - if (params.entries().next().value[1] == 'game') Engine.GameMaster.changeScene(new GameScene('Mission 1')); + if (params.entries().next().value[1] == 'game') Engine.GameMaster.changeScene(new GameScene('The Turn')); if (Engine.latestCommit != 'DEVELOPMENT') window.onbeforeunload = () => {