From 878bac1f4fc0a0f3f69481dc4a80fc93864b62e0 Mon Sep 17 00:00:00 2001 From: Nikita Iryupin Date: Sat, 5 Jun 2021 14:19:44 +0200 Subject: [PATCH] Added Tank speed constants --- src/Tanks/tank.js | 2 +- src/constants.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Tanks/tank.js b/src/Tanks/tank.js index 727ca3b..818ca05 100644 --- a/src/Tanks/tank.js +++ b/src/Tanks/tank.js @@ -10,7 +10,7 @@ export class Tank { this.x = x; this.y = y; this.collisionManager = collisionManager; - this.speed = 3.0; + this.speed = Constants.TANK_SPEED.getValue(); this.direction = DirectionEnum.Up; this.isDestroyed = false; diff --git a/src/constants.js b/src/constants.js index 720aa47..e59f10b 100644 --- a/src/constants.js +++ b/src/constants.js @@ -2,6 +2,7 @@ export class Constants { static TILE_SIZE = new Constants(32); static TANK_SIZE = new Constants(24); static TANK_COLL_OFFSET = new Constants(0.05); + static TANK_SPEED = new Constants(2.0); static SHOT_SPEED = new Constants(2.0); static SHOT_SIZE = new Constants(5);