Skip to content

Player Movement Testing Plan

racheljadel edited this page Aug 31, 2023 · 1 revision

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:

  1. Create a KeyboardPlayerInputComponent named test.
  2. Simulate pressing down (KeyDown) either one or two directional keys (W/A/S/D).
  3. Ensure that the direction the player is moving is accurate and desired (W = up, A = left, W/A = up left, etc.).
  4. Simulate the release of the pressed-down key/s (KeyUp).
  5. 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:

  1. Create a KeyboardPlayerInputComponent named test.
  2. Simulate pressing down (KeyDown) one directional key (W/A/S/D) and the space bar (causing the player to 'dodge').
  3. Ensure that the direction the player is moving is accurate and desired (W/Space = up, A/Space = left, etc.).
Clone this wiki locally