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
A playable “Forest” style room. This class:
- Loads assets for this scene
- Builds the terrain and screen edges
- Spawns the player, props (desk, crates, energy pod), a keycard door, and enemies
- Starts background music
Think of this as the level assembler as it doesn’t know how to build each object,
it just asks the right factories to create them and places them in the world.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.csse3200.game.areas.GameArea
GameArea.Bounds
-
Field Summary
Fields inherited from class com.csse3200.game.areas.GameArea
areaEntities, baseScaling, cameraComponent, isTransitioning, roomNumber, terrain, terrainFactory, wavesManager
-
Constructor Summary
ConstructorsConstructorDescriptionForestGameArea
(TerrainFactory terrainFactory, CameraComponent cameraComponent) Initialise this ForestGameArea to use the provided TerrainFactory and camera helper. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Entry point for this room.allows manipulation of player character by loading functionstatic ForestGameArea
load
(TerrainFactory terrainFactory, CameraComponent cameraComponent) void
toString()
Methods inherited from class com.csse3200.game.areas.GameArea
addSolidWallBottom, addSolidWallLeft, addSolidWallRight, addSolidWallTop, addVerticalDoorLeft, addVerticalDoorRight, beginTransition, clearAndLoad, dispose, endTransition, ensurePlayerAtlas, ensureTextures, getBaseDifficultyScale, getCameraBounds, getEnemySpawnPosition, getEntities, getRoomNumber, getRoomSpawnPosition, loadArea, removeEntity, setupTerrainWithOverlay, spawnDeepspin, spawnEnemies, spawnEntity, spawnEntityAt, spawnEntityInRoom, spawnFloor, spawnGhostGPT, spawnGhostGPTProjectile, spawnGrokDroid, spawnObjectDoors, spawnTurret, spawnVroomba, startWaves, unloadAssets
-
Constructor Details
-
ForestGameArea
Initialise this ForestGameArea to use the provided TerrainFactory and camera helper. The camera is used to size the screen-edge walls and place the right-side door trigger.- Parameters:
terrainFactory
- TerrainFactory used to create the terrain for the GameArea (required).cameraComponent
- Camera helper supplying an OrthographicCamera (optional but used here).- Requires:
- terrainFactory != null
-
-
Method Details
-
create
public void create()Entry point for this room. This: - Loads textures/sounds/music - Registers this room in the ServiceLocator - Creates the terrain, walls, and UI label - Spawns player, props (desk, crates, pod), door (with keycard gate), and enemies - Starts background music -
spawnItem
-
getPlayer
Description copied from class:GameArea
allows manipulation of player character by loading function -
toString
-
load
-