diff --git a/public/stages/stage-1.json b/public/stages/stage-1.json index d9c7f5c..6229135 100644 --- a/public/stages/stage-1.json +++ b/public/stages/stage-1.json @@ -15,7 +15,7 @@ "X Bf X Bf X B8 Bc B4 X Bf X Bf X ", "X X X X X Ba Ef B5 X X X X X " ], - "bots": 1, + "bots": 10, "size": { "width": 13, "height": 13 diff --git a/public/stages/stage-2.json b/public/stages/stage-2.json index c8c3b9a..432abdd 100644 --- a/public/stages/stage-2.json +++ b/public/stages/stage-2.json @@ -15,7 +15,7 @@ "X BF X X X B8 BC B4 X BF X BF X ", "X BF X BF X BA Ef B5 X BF BF BF X " ], - "bots": 1, + "bots": 10, "size": { "width": 13, "height": 13 diff --git a/public/stages/stage-3.json b/public/stages/stage-3.json index ad3b4dd..2317c69 100644 --- a/public/stages/stage-3.json +++ b/public/stages/stage-3.json @@ -15,7 +15,7 @@ "BF BF X T5 X B8 BC B4 X Ff Ff Ff X ", "TF BF BF X X BA Ef B5 X BF X X X " ], - "bots": 20, + "bots": 10, "size": { "width": 13, "height": 13 diff --git a/public/stages/stage-4.json b/public/stages/stage-4.json index a5c1486..3200efd 100644 --- a/public/stages/stage-4.json +++ b/public/stages/stage-4.json @@ -15,7 +15,7 @@ "Ff X B3 B3 X B8 Bc B4 B3 B3 X Ff Ff ", "Tf Ff X X X Ba Ef B5 X X Ff Ff Tf " ], - "bots": 20, + "bots": 10, "size": { "width": 13, "height": 13 diff --git a/src/Blocks/types/block.js b/src/Blocks/types/block.js index e5034d4..468e19e 100644 --- a/src/Blocks/types/block.js +++ b/src/Blocks/types/block.js @@ -87,6 +87,5 @@ export class Box { this._hBox = this._hBox - (this._hOriginBox / 2); break; } - console.log(this._hBox + " " + this._wBox); } } \ No newline at end of file diff --git a/src/GameLogic/gameField.js b/src/GameLogic/gameField.js index 1efdfbf..1912096 100644 --- a/src/GameLogic/gameField.js +++ b/src/GameLogic/gameField.js @@ -129,7 +129,7 @@ export class GameField { setTimeout(() => { cancelAnimationFrame(this.lastRequest); this.lastRequest = undefined; - this.play(1, false); + this.play(Constants.STAY_ON_LEVEL_AFTER_DEATH.getValue() ? this.map.mapLevel : 0, false); }, 2000); } diff --git a/src/Tanks/aiTankManager.js b/src/Tanks/aiTankManager.js index 1a0270d..739bbc4 100644 --- a/src/Tanks/aiTankManager.js +++ b/src/Tanks/aiTankManager.js @@ -9,7 +9,7 @@ export class AITankManager { * @param {CollisionManager} collisionManager */ constructor(collisionManager) { - this.MAX_TANKS_ON_FIELD = 2; + this.maxTanks = Constants.MAX_ACTIVE_TANKS_ON_LEVEL.getValue(); this._count = null; this._collision = collisionManager; @@ -38,7 +38,7 @@ export class AITankManager { this._collision.addNewAITank(tank); } - if (this._activeTanks.length >= this.MAX_TANKS_ON_FIELD) + if (this._activeTanks.length >= this.maxTanks) this._canSpawn = false; } diff --git a/src/constants.js b/src/constants.js index b4f2491..0ae9412 100644 --- a/src/constants.js +++ b/src/constants.js @@ -6,6 +6,10 @@ export class Constants { static TANK_DEFAULT_SPAWN_X = new Constants(4*this.TILE_SIZE.getValue()); static TANK_DEFAULT_SPAWN_Y = new Constants(12*this.TILE_SIZE.getValue()); + static MAX_ACTIVE_TANKS_ON_LEVEL = new Constants(3); + + static STAY_ON_LEVEL_AFTER_DEATH = new Constants(true); + static SHOT_SPEED = new Constants(2.0); static SHOT_SIZE = new Constants(5);