Player Movement Testing Plan - UQcsse3200/2023-studio-2 GitHub Wiki
Introduction:
Player movement is an integral aspect of the game's function, and although in-built movement was already implemented in the base game, it was important to update diagonal movement to be scaled to the correct speed. Moreover, a dodge feature was also added for further game complexity, Therefore, these implementations must be adequately tested, and so KeyboardPlayerInputComponent
was tested in accordance with the following testing plan:
Test Plan for KeyboardPlayerInputComponent
Objective:
To validate the correct behaviour of the player after pressing down directional keys (W/A/S/D) and the space bar in the KeyboardPlayerInputComponent
class by ensuring:
- The player is moving in the correct direction for both four-directional movement and diagonal movement.
- The player is moving in the correct direction when dodging (as based off the player's previous four-directional movement)
- Once the key is released, the player stops moving (only applicable for player walking, as dodging is a timed movement)
Methodology:
Test Cases 1-8: testUp/Down/Right etc.
Objective: To validate the direction of the player's movement after pressing specific keys (W/A/S/D).
Steps:
- Create a KeyboardPlayerInputComponent named test.
- Simulate pressing down (
KeyDown
) either one or two directional keys (W/A/S/D). - Ensure that the direction the player is moving is accurate and desired (W = up, A = left, W/A = up left, etc.).
- Simulate the release of the pressed-down key/s (
KeyUp
). - Ensure that the player is now not moving in any direction.
Test Cases 9-12: testDodgeUp/Down/Right etc.
Objective: To validate the direction the player is dodging after pressing specific keys (W/A/S/D) and the space bar.
Steps:
- Create a KeyboardPlayerInputComponent named test.
- Simulate pressing down (
KeyDown
) one directional key (W/A/S/D) and the space bar (causing the player to 'dodge'). - Ensure that the direction the player is moving is accurate and desired (W/Space = up, A/Space = left, etc.).