Level Connections - UQcsse3200/2024-studio-1 GitHub Wiki
LEVEL SYSTEM
levelclass
- The Level class represents a single layer of the game, consisting of multiple rooms for the player to navigate and overcome challenges.
Level factory
- is an model for setting different levels in the game to a certain level, which in fact can be understood as the “game mode” setter
Class Overview
The Level class denotes the structure and properties of a game level, it presents its map, rooms, and traversal information
Key Components
- LevelMap: Represents the layout and connections between rooms.
- Level Number: Identifies the current level in the game progression.
- Rooms: A collection of Room objects, each representing a distinct area within the level.
- Room Traversals: Tracks the number of room transitions made by the player.
Core Methods
getRoom(String roomKey)
- Retrieves a specific room based on its unique key.getStartingRoomKey()
- Returns the key of the initial room where the player starts the level.getLevelNumber()
- Provides the current level number.getRoomTraversals()
- Returns
Usage
Factory Interface overview
This interface allows for the implementation of various level generation strategies, enabling different game modes or difficulty settings.
Core Method
create(int levelNum)
: Generates a new Level object based on the specified level number.