From 3c3abb31ede9f1737584203f549ed0479600ae22 Mon Sep 17 00:00:00 2001 From: Nutria Date: Fri, 20 Oct 2023 17:33:17 +0900 Subject: [PATCH] Delete duplicate code and optimize code --- src/entity/Ship.java | 7 ------- src/screen/GameScreen.java | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/entity/Ship.java b/src/entity/Ship.java index 9eda907a..2b6c2fca 100644 --- a/src/entity/Ship.java +++ b/src/entity/Ship.java @@ -138,13 +138,6 @@ public final void update() { else this.spriteType = SpriteType.Ship; } - public final void updatep_2() { - this.skillCooldown.checkFinished(); - if (!this.destructionCooldown.checkFinished()) - this.spriteType = SpriteType.ShipDestroyed; - else - this.spriteType = SpriteType.Ship2; - } /** * Switches the ship to its destroyed state. diff --git a/src/screen/GameScreen.java b/src/screen/GameScreen.java index 8488cfae..bc72b063 100644 --- a/src/screen/GameScreen.java +++ b/src/screen/GameScreen.java @@ -636,7 +636,7 @@ else if (this.enemyShipSpecialExplosionCooldown.checkFinished()) { this.ship.update(); if (this.gameState.getMode() == 2) { - this.ship2.updatep_2(); + this.ship2.update(); } this.enemyShipFormation.update();