Class CombatArea

java.lang.Object
com.csse3200.game.areas.GameArea
com.csse3200.game.areas.combat.CombatArea
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public class CombatArea extends GameArea
Forest area for the demo game with trees, a player, and some enemies.
  • Field Details

  • Constructor Details

    • CombatArea

      public CombatArea(Entity player, Entity enemy, GdxGame game, CombatTerrainFactory terrainFactory)
      Initialise this ForestGameArea to use the provided CombatTerrainFactory and the enemy which player has engaged combat with.
      Parameters:
      terrainFactory - CombatTerrainFactory used to create the terrain for the GameArea.
      Requires:
      terrainFactory != null
  • Method Details

    • create

      public void create()
      Create the game area, including terrain, static entities (trees), dynamic entities (player)
      Specified by:
      create in class GameArea
    • spawnTerrain

      public void spawnTerrain()
      Spawns the official backgrond terrain for combat using combat terrain factory
    • startEnemyAnimation

      public void startEnemyAnimation(CombatArea.CombatAnimation animation)
      Plays an enemy animation in combat
      Parameters:
      animation - CombatAnimation (IDLE or MOVE) to trigger
    • startPlayerAnimation

      public void startPlayerAnimation(CombatArea.CombatAnimation animation)
      Plays a player animation in combat
      Parameters:
      animation - CombatAnimation (IDLE or MOVE) to trigger
    • playMusic

      public void playMusic()
      Play the music for combat
      Specified by:
      playMusic in class GameArea
    • pauseMusic

      public void pauseMusic()
      Pause the music for combat. Will be finalised and used when combat pause is implemented
      Specified by:
      pauseMusic in class GameArea
    • unloadAssets

      public void unloadAssets()
      Specified by:
      unloadAssets in class GameArea
    • dispose

      public void dispose()
      Description copied from class: GameArea
      Dispose of all internal entities in the area
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class GameArea
    • getPlayer

      public Entity getPlayer()
      Specified by:
      getPlayer in class GameArea
    • getEnemies

      public List<Entity> getEnemies()
      Specified by:
      getEnemies in class GameArea
    • getBosses

      public List<Entity> getBosses()
      Specified by:
      getBosses in class GameArea
    • getFriendlyNPCs

      public List<Entity> getFriendlyNPCs()
      Specified by:
      getFriendlyNPCs in class GameArea
    • getMinigameNPCs

      public List<Entity> getMinigameNPCs()
      Specified by:
      getMinigameNPCs in class GameArea