Skip to content

Commit

Permalink
Moved logic of engineer death when Mob reaches end
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasakev committed Oct 17, 2023
1 parent 4cb625b commit 6471007
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public void create() {
waves.getEvents().addListener("spawnWave", this::spawnMob);

spawnScrap();
spawnGapScanners();
// spawnGapScanners();
}

private void displayUI() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,19 @@ public void update() {

if(mob.getCenterPosition().x <= 1) {
mob.getComponent(CombatStatsComponent.class).setHealth(0);
ServiceLocator.getGameEndService().updateEngineerCount();

}

// death check
if ((mob.getComponent(CombatStatsComponent.class).getHealth() <= 0 && !deathFlag)) {
// decrement engineer count
// ! tests failing because of textbox

ServiceLocator.getGameEndService().updateEngineerCount();
changeState(State.DEATH);
animate();
movementTask.stop();
deathFlag = true;


} else if (deathFlag && animation.isFinished()) {
ServiceLocator.getWaveService().updateEnemyCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public class IceBabyTask extends DefaultTask implements PriorityTask {
private Vector2 currentPos;
private Vector2 walkPos;
private MovementTask walkTask;
private static int xRightBoundary = 17;
private static int xLeftBoundary = 12;
private int xRightBoundary = 17;
private int xLeftBoundary = 12;
private boolean startFlag = false;
private boolean isWalking;
/** Animation constants */
Expand Down

0 comments on commit 6471007

Please sign in to comment.