Package com.csse3200.game.areas
Class ForestGameArea
java.lang.Object
com.csse3200.game.areas.GameArea
com.csse3200.game.areas.ForestGameArea
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Forest area for the demo game with trees, a player, and some enemies.
-
Field Summary
Fields inherited from class com.csse3200.game.areas.GameArea
areaEntities, combatStats, inventory, player, terrain
-
Constructor Summary
ConstructorsConstructorDescriptionForestGameArea
(TerrainFactory terrainFactory) Initialise this ForestGameArea to use the provided TerrainFactory. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Dispose of all internal entities in the areaprotected void
Loads assetsprotected void
Load entities.protected void
Load terrain, UI, music.void
spawnKey()
protected Entity
Spawns playerprotected Entity
spawnPlayer
(List<Component> componentList) Spawns player with previous componentsvoid
spawnUpgrade
(String upgradeID, int posx, int posy) Methods inherited from class com.csse3200.game.areas.GameArea
create, createMinimap, createWithPlayer, getComponents, getEvents, getPlayer, reset, saveComponents, spawnEntity, spawnEntityAt, trigger
-
Constructor Details
-
ForestGameArea
Initialise this ForestGameArea to use the provided TerrainFactory.- Parameters:
terrainFactory
- TerrainFactory used to create the terrain for the GameArea.- Requires:
- terrainFactory != null
-
-
Method Details
-
loadPrerequisites
protected void loadPrerequisites()Load terrain, UI, music. Must be done before spawning entities. Assets are loaded separately. Entities spawned separately.- Specified by:
loadPrerequisites
in classGameArea
-
loadEntities
protected void loadEntities()Load entities. Terrain must be loaded beforehand. Player must be spawned beforehand if spawning enemies.- Specified by:
loadEntities
in classGameArea
-
spawnPlayer
Description copied from class:GameArea
Spawns player- Specified by:
spawnPlayer
in classGameArea
- Returns:
- player entity
-
spawnPlayer
Description copied from class:GameArea
Spawns player with previous components- Specified by:
spawnPlayer
in classGameArea
- Parameters:
componentList
-- Returns:
- Player entity with old components
-
spawnKey
public void spawnKey() -
spawnUpgrade
-
loadAssets
protected void loadAssets()Description copied from class:GameArea
Loads assets- Specified by:
loadAssets
in classGameArea
-
dispose
public void dispose()Description copied from class:GameArea
Dispose of all internal entities in the area
-