Skip to content

Commit

Permalink
Fix the previous commit which failed tests + Remove some unneccessary…
Browse files Browse the repository at this point in the history
… comments
  • Loading branch information
lenhatminh451 committed Oct 17, 2023
1 parent 66e8299 commit 5aa77d0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
public class BombshipCombatTask extends DefaultTask implements PriorityTask {
private static final int INTERVAL = 1; // The time interval for each target scan from the Engineer.
private static final int PRIORITY = 3; // Default priority of the combat task when mobs are in range.
// private static final short TARGET1 = PhysicsLayer.BOSS; // The type of targets that the Engineer will detect.
// private static final short TARGET2 = PhysicsLayer.XENO;

// Animation event names for the Engineer's state machine.
private static final String START = "start";
Expand All @@ -30,12 +28,6 @@ public class BombshipCombatTask extends DefaultTask implements PriorityTask {
private PhysicsEngine physics;
private GameTime timeSource;
private long endTime;
/*
private long reloadTime;
private ArrayList<RaycastHit> hits = new ArrayList<>();
private final RaycastHit hit = new RaycastHit();
private ArrayList<Vector2> targets = new ArrayList<>();
*/

/** The Engineer's states. */
private enum STATE {
Expand Down Expand Up @@ -128,28 +120,5 @@ public int getPriority() {
public boolean isEngineerDied() {
return true;
}

/**
* Fetches the nearest target from the array of detected target positions created during the last call of
* this could be done in the next sprint , the scan doesnt work as of now !
* @return a Vector2 position of the nearest mob detected.
*/
/** public Vector2 fetchTarget() {
// Initial nearest position for comparison
int lowest = 10;
Vector2 nearest = new Vector2(owner.getEntity().getCenterPosition().x,
owner.getEntity().getCenterPosition().y);
// Find the nearest target from the array of targets
for (Vector2 tgt : targets){
if (Math.abs(tgt.y - nearest.y) < lowest) {
lowest = (int)Math.abs(tgt.y - nearest.y);
nearest = tgt;
}
}
return nearest;
}
*/
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.csse3200.game.components.tower;

import com.badlogic.gdx.audio.Sound;
import com.csse3200.game.components.Component;
import com.csse3200.game.rendering.AnimationRenderComponent;
import com.csse3200.game.services.ServiceLocator;

/**
* Listens for events relevant to a weapon tower state.
Expand All @@ -19,7 +21,6 @@ public class FireTowerAnimationController extends Component{
private static final String PREP_ATTACK_ANIM = "prepAttack";
private static final String ATTACK_ANIM = "attack";
private static final String DEATH_ANIM = "death";
//here we can add the sounds for the implemented animations

private static final String FIRE_SINGLE_SFX = "sounds/towers/Desert-Eagle-Far-Single-Gunshot.mp3";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.csse3200.game.components.tower;

import com.badlogic.gdx.audio.Sound;
import com.csse3200.game.components.Component;
import com.csse3200.game.rendering.AnimationRenderComponent;
import com.csse3200.game.services.ServiceLocator;

/**
* Listens to triggers phrases and executes the required animations.
Expand All @@ -16,8 +18,6 @@ public class StunTowerAnimationController extends Component {
private static final String ATTACK_ANIM = "attack";
private static final String DEATH_ANIM = "death";

//further sounds can be added for the tower attacks/movement

private static final String FIRE_SINGLE_SFX = "sounds/towers/ar15_single_shot_far.mp3";

private final Sound fireSingleSound = ServiceLocator.getResourceService().getAsset(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.HashSet;
import java.util.Set;


/**
* Factory to create a tower entity.
*
Expand All @@ -44,8 +43,6 @@ public class TowerFactory {
private static final int TNT_TOWER_MAX_RANGE = 6;
private static final int TNT_TOWER_RANGE = 6;
private static final int TNT_KNOCK_BACK_FORCE = 10;
// private static final String WALL_IMAGE = "images/towers/wall_tower.png";
// private static final String RESOURCE_TOWER = "images/towers/mine_tower.png";
private static final String TURRET_ATLAS = "images/towers/turret01.atlas";
private static final String FIRE_TOWER_ATLAS = "images/towers/fire_tower_atlas.atlas";
private static final String STUN_TOWER_ATLAS = "images/towers/stun_tower.atlas";
Expand Down

0 comments on commit 5aa77d0

Please sign in to comment.