Class GameArea

java.lang.Object
com.csse3200.game.areas.GameArea
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Direct Known Subclasses:
LevelGameArea

public abstract class GameArea extends Object implements com.badlogic.gdx.utils.Disposable
Represents an area in the game, such as a level, indoor area, etc. An area has a terrain and other entities to spawn on that terrain.

Support for enabling/disabling game areas could be added by making this a Component instead.

  • Field Details

  • Constructor Details

    • GameArea

      protected GameArea()
  • Method Details

    • create

      public abstract void create()
      Create the game area in the world.
    • dispose

      public void dispose()
      Dispose of all internal entities in the area
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
    • spawnEntity

      protected void spawnEntity(Entity entity)
      Spawn entity at its current position
      Parameters:
      entity - Entity (not yet registered)
    • despawnEntity

      protected void despawnEntity(Entity entity)
    • requestDespawn

      public void requestDespawn(Entity entity)
    • getEntities

      public List<Entity> getEntities()
      Gets all entities in this area.
      Returns:
      list of entities in this area
    • spawnRobotAtTile

      public Entity spawnRobotAtTile(com.badlogic.gdx.math.GridPoint2 cell, boolean centerX, boolean centerY)
    • spawnRobotAtTile

      public Entity spawnRobotAtTile(com.badlogic.gdx.math.GridPoint2 cell, boolean centerX, boolean centerY, String robotType)
    • spawnRobotAtFloat

      public Entity spawnRobotAtFloat(float x, float y)
    • spawnRobotAtFloat

      public Entity spawnRobotAtFloat(float x, float y, String robotType)
    • setWaveManager

      public void setWaveManager(WaveManager waveManager)
      Sets the WaveManager reference for disposal tracking
      Parameters:
      waveManager - the WaveManager instance