-
Notifications
You must be signed in to change notification settings - Fork 0
Player State Manager
As the game grows in complexity, the player can be in a variety of different states. As such, the current method of determining the players state will eventually become too difficult to use, and therefore a new PlayerStateComponent
class will be made to handle this.
This class will be important for animations. The method getStateAnimation
returns a string based on the Player
's Health and Movement state. As such, as long as these strings matches the names of the images for animation, this method can be called whenever the player's state changes such that the players animation changes aswell.
Java enums were used to store constant variables to describe the player's Health
, State
and Direction
:
enum Health {
NORMAL, // 100 - 90 Health
ROUGH, // 90 - 50 Health
DAMAGED, // 50 - 10 Health
DEAD // 0 Health
}
enum State {
STATIONARY,
WALK,
SPRINT,
JUMP,
SPRINT_JUMP
}
enum Direction {
LEFT,
RIGHT
}
General getter and setter methods were implemented, as well as getStateAnimation()
which uses switch statements to determine what animation the player should be in.
Additionally, the manage()
method was implemented in order to determine which state the player should be in if multiple states are true. For example, if the player is moving left, sprinting and jumping, they should be in the SPRINT_JUMP state with LEFT direction
Methods to update and manage states are called within the KeyboardPlayerInputComponent
class, as this class handles key up and key down events.
The PlayerStateComponentTest
uses JUnit5 to test all the methods of the class.
- Player UI
- Popup Menus
- Obstacles
- Boss Enemies
- Progress Tracker
- Checkpoint Design and Functionality
- Score System
- Lives System
- Game Background
- Multiple game-level
- Visual Improvements
- Tutorial Level
- Character Design and Animations
- Character Damage Animations
- Player Animation Functionalities
- Player and Serpent Portal Transition
- Pop-up Menus
- Obstacles
- Lives & Score User Testing
- Buffs & Debuffs
- Buffs & Debuffs redesign
- Obstacle Animation
- Background Design
- Level 2 Background Appearance
- Enemy Monster User Testing
- Level 1 Floor Terrain Testing
- Introduction Screens User Testing
- Character Movement Interviews & User Testing
- Sound user testing
- Level 2 Obstacles and enemy
- Story, Loading, Level 4 and Win Condition Sound Design User Testing
- Giant Bug and Purple Squid animation user testing
- General Gameplay and Tutorial Level User Testing
- Level 4 Terrain User Testing
- Game Outro User Testing