-
Notifications
You must be signed in to change notification settings - Fork 0
KeyboardPlayerInputComponent & Player Sprint Refactor
Since more classes now rely on KeyboardPlayerInputComponent
, (such as PlayerStateComponent
) a general clean-up of the code written is necessary, to improve readability and also allow other classes to use KeyboardPlayerInputComponent
more easily.
Additionally, Sprint
will be changed to rely upon a SPRINT_MODIFIER
, which means that the sprint feature can be easily changed when under the effect of buffs or debuffs, etc..
Sprinting Changes
A sprint modifier variable was added:
/**
* SPRINT MODIFIER - This can be changed (when buffed, etc.)
* Change this value to control how fast the player moves whilst under the effect of sprint
*/
public static int SPRINT_MODIFIER = 2;
Sprint now relies upon this value, which is seen in the below implementation:
this.walkDirection.add(Vector2Utils.RIGHT.cpy().scl(SPRINT_MODIFIER));
KeyboardPlayerInputComponent Changes
On all keyUp
and keyDown
situations, the following method is called:
private boolean handleWalk(char Key, String keyState);
This method factors out large chucks of code, and makes the keyUp
and keyDown
methods far more readable:
public boolean keyDown(int keycode) {
switch (keycode) {
case Keys.SPACE:
return jump();
case Keys.A:
return handleWalk('A', "DOWN");
case Keys.D:
return handleWalk('D', "DOWN");
case Keys.SHIFT_LEFT:
return handleSprint(true);
default:
return false;
}
}
Where handleWalk()
is simply the factored-out sprint & walk logic at any keyDown or keyUp event.
- 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