Class AtlantisGameArea

java.lang.Object
com.deco2800.game.areas.GameArea
com.deco2800.game.areas.AtlantisGameArea
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public class AtlantisGameArea extends GameArea
Atlantis game area for creating the map the game is played in
  • Field Details

    • forestTextures

      public static final String[] forestTextures
    • uiTextures

      public static final String[] uiTextures
    • buildingPlacementTextures

      public static final String[] buildingPlacementTextures
    • forestTextureAtlases

      public static final String[] forestTextureAtlases
    • soldierMenuTextures

      public static final String[] soldierMenuTextures
    • buildingMenuTextures

      public static final String[] buildingMenuTextures
    • atlantisSounds

      public static final String[] atlantisSounds
  • Constructor Details

  • Method Details

    • create

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

      public void startFlooding()
      Starts the map flooding event.
    • spawnSnakes

      public void spawnSnakes(com.badlogic.gdx.math.Vector2 spawnPoint)
      Spawns Snake enemy entities
    • spawnExplosion

      public void spawnExplosion(Entity entity)
    • isOcean

      public boolean isOcean(com.badlogic.gdx.math.GridPoint2 tile)
      Lets us check whether a tile is in the ocean

      Will be useful if changes from cleanup branch are adopted

      Parameters:
      tile - the tile to check
      Returns:
      whether it is ocean or not
    • getGameAreaEventHandler

      public EventHandler getGameAreaEventHandler()
      Returns:
      the Atlantis Game Area event handler
    • getEntityByID

      public List<Entity> getEntityByID(int id)
      Gets the entity(ies) in the area which match the given id. Used primarily for debugging purposes
      Parameters:
      id - the id to search for
      Returns:
      the entities matching the given ID
    • 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
    • isRegionClear

      public boolean isRegionClear(com.badlogic.gdx.physics.box2d.PolygonShape shape)
      Check that a shape would not collide with any placed entities

      Assumes a convex polygon

      Parameters:
      shape - the shape to test for collisions
      Returns:
      true if there are no colliders in region, false otherwise
    • flood

      public void flood()