This commit is contained in:
Scott Anderson
2025-04-09 04:18:18 -04:00
parent 3b07f78e97
commit b38e6a845d
25 changed files with 131 additions and 124 deletions
+3 -3
View File
@@ -76,7 +76,7 @@ export class ControlPanel extends LitElement implements Layer {
newAttackRatio = 1;
}
if (newAttackRatio == 0.11 && this.attackRatio == 0.01) {
if (newAttackRatio === 0.11 && this.attackRatio === 0.01) {
// If we're changing the ratio from 1%, then set it to 10% instead of 11% to keep a consistency
newAttackRatio = 0.1;
}
@@ -92,13 +92,13 @@ export class ControlPanel extends LitElement implements Layer {
}
const player = this.game.myPlayer();
if (player == null || !player.isAlive()) {
if (player === null || !player.isAlive()) {
this.setVisibile(false);
return;
}
const popIncreaseRate = player.population() - this._population;
if (this.game.ticks() % 5 == 0) {
if (this.game.ticks() % 5 === 0) {
this._popRateIsIncreasing =
popIncreaseRate >= this._lastPopulationIncreaseRate;
this._lastPopulationIncreaseRate = popIncreaseRate;