Package com.deco2800.game.areas
Class AtlantisGameArea
java.lang.Object
com.deco2800.game.areas.GameArea
com.deco2800.game.areas.AtlantisGameArea
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Atlantis game area for creating the map the game is played in
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]
static final String[]
static final String[]
static final String[]
static final String[]
static final String[]
static final String[]
Fields inherited from class com.deco2800.game.areas.GameArea
areaEntities, terrain
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Create the game area, including terrain, static entities (resources), dynamic entities (player)void
dispose()
Dispose of all internal entities in the areavoid
flood()
getEntityByID
(int id) Gets the entity(ies) in the area which match the given id.boolean
isOcean
(com.badlogic.gdx.math.GridPoint2 tile) Lets us check whether a tile is in the oceanboolean
isRegionClear
(com.badlogic.gdx.physics.box2d.PolygonShape shape) Check that a shape would not collide with any placed entitiesvoid
spawnExplosion
(Entity entity) void
spawnSnakes
(com.badlogic.gdx.math.Vector2 spawnPoint) Spawns Snake enemy entitiesvoid
Starts the map flooding event.Methods inherited from class com.deco2800.game.areas.GameArea
spawnEntity, spawnEntity, spawnEntityAt, spawnEntityAt
-
Field Details
-
forestTextures
-
uiTextures
-
buildingPlacementTextures
-
forestTextureAtlases
-
soldierMenuTextures
-
buildingMenuTextures
-
atlantisSounds
-
-
Constructor Details
-
AtlantisGameArea
-
-
Method Details
-
create
public void create()Create the game area, including terrain, static entities (resources), dynamic entities (player) -
startFlooding
public void startFlooding()Starts the map flooding event. -
spawnSnakes
public void spawnSnakes(com.badlogic.gdx.math.Vector2 spawnPoint) Spawns Snake enemy entities -
spawnExplosion
-
isOcean
public boolean isOcean(com.badlogic.gdx.math.GridPoint2 tile) Lets us check whether a tile is in the oceanWill be useful if changes from cleanup branch are adopted
- Parameters:
tile
- the tile to check- Returns:
- whether it is ocean or not
-
getGameAreaEventHandler
- Returns:
- the Atlantis Game Area event handler
-
getEntityByID
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 -
isRegionClear
public boolean isRegionClear(com.badlogic.gdx.physics.box2d.PolygonShape shape) Check that a shape would not collide with any placed entitiesAssumes 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()
-