Class EnemyWaves

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.enemy.EnemyWaves

public class EnemyWaves extends Component
Handles spawning enemies over multiple waves. Simplified: a fixed number of waves per trigger.
  • Constructor Details

    • EnemyWaves

      public EnemyWaves(int maxWaves, GameArea area, Entity player)
    • EnemyWaves

      public EnemyWaves(GameArea area, Entity player)
  • Method Details

    • startWave

      public void startWave()
      Start or resume wave logic. If all waves previously finished, this restarts from wave 0.
    • allWavesFinished

      public boolean allWavesFinished()
      Checks if all the waves in the current room have finished.
      Returns:
      True if all waves have finished, false otherwise.
    • isCurrentWaveFinished

      public boolean isCurrentWaveFinished()
      Checks if the current wave has finished.
      Returns:
      True if the current wave has finished, false otherwise.
    • getMaxWaves

      public int getMaxWaves()
      Returns the maximum number of waves in the current room.
      Returns:
      The maxWaves as an int.
    • getScalingFactor

      public float getScalingFactor()
      Returns the scaling factor of the enemies in the next wave.
      Returns:
      The scaling factor as a float.
    • getWaveNumber

      public int getWaveNumber()
      Returns the wave number of the next wave in the current room.
      Returns:
      The wave number as an int.
    • getWaveEndTime

      public long getWaveEndTime()
      Returns the time stamp of when the previous wave ended in the current room if no enemies are alive otherwise returns 0.
      Returns:
      The wave end time in milliseconds as a long.
    • setMaxWaves

      public void setMaxWaves(int maxWaves)
      Sets the maximum number of waves in the current room.
      Parameters:
      maxWaves - The maximum number of waves as an int.
    • setScalingFactor

      public void setScalingFactor(float scalingFactor)
      Sets the scaling factor of the enemies in the next wave.
      Parameters:
      scalingFactor - The scaling factor as a float.
    • setWaveNumber

      public void setWaveNumber(int waveNumber)
      Sets the wave number of the next wave in the current room.
      Parameters:
      waveNumber - The wave number as an int.
    • setWaveEndTime

      public void setWaveEndTime(long waveEndTime)
      Sets the time stamp of when the previous wave ended in the current room
      Parameters:
      waveEndTime - The wave end time in milliseconds as a long .