-
Notifications
You must be signed in to change notification settings - Fork 1
GameAreaService
AElanagai edited this page Oct 16, 2024
·
2 revisions
GameAreaService
is a service that provides access to the GameController and GameArea within the game. It acts as an intermediary, allowing other classes to interact with the game area and controller without direct dependencies.Basically it is a service for classes that need to spawn and dispose entities in the gamearea within their own class
-
GameController
: The main controller for the game, managing levels, rooms, and game state. -
GameArea
: Represents the current game area, handling entity spawning and disposal.
-
getGameArea()
: Returns the current GameArea object. -
getGameController()
: Returns the GameController object. -
update()
: Triggers the spawning of the current room in the GameController.
ServiceLocator.registerGameAreaService(new GameAreaService(gameController));
// spawning created entity
ServiceLocator.getGameAreaService().getGameArea().spawnEntity(entity);
// disposing entity
ServiceLocator.getGameAreaService().getGameArea().disposeEntity(entity);
- Spawn or dispose of entities from a class that doesn't directly interact with the game area.
- Access the GameController for game state management.
- Trigger updates to the current room or game state.
Correct implementation - is the WeaponComponent
, that needs to spawn a projectile entity based off a triggered event acting within the bound of its class.
Incorrect implementation - is using the service in Rooms unnecessarily when the GameArea
is passed as an argument to the function
Design Choices
Utilities
Animals
Menus/screens
Character
- Character Animations
- Character's Inventory On Display
- Character's Inventory System
- Character's HealthBar
- Character's Interaction with Items
- Character achievements
- Saving Character
- Player-(and-other-NPC)-invincibility-frames
- Player Factory
- Scoring System
- Test Plan for Inventory System
- Test Plan for Player's Interaction with Items
- Test Plan for Player's Inventory Display
- Test Plan for Saving Character State
- Test Plan for Scoring System
Map
Weapon
- Weapon Overview
- Weapon Types
- Weapon Structure
- Weapon Stats Display
- Testing Plan for Weapon Factory
- Testing Plan for Firing Controller Component
- Testing Plan for Position Tracker Component
- Testing Plan for Weapon Animation Controller component
- Testing Plan for Concrete Melee Weapon class
- Testing Plan for Concrete Ranged Weapon class