2.2.2 Cycle 2 - Movement
Last updated
Last updated
In the second cycle, my objectives are to implement the basic controls and allow the player's character to move around the screen. Completing the steps in this order should lay out a strong, progressive structure for my game. The layers don't need to be too detailed at this point, graphics quality improvements can be adjusted later on.
Implementing my simple game controls into the project. This will allow the user to move their character around the map as discussed in .
moveSpeed
Defines the value for player movement speed.
The player is now able to be controlled once they have been rendered, the code for this can be viewed below:
Some challenges I faced during this cycle:
Finding the correct code to correspond with the selected key bindings.
Allowing multiple actions at once (jump and direction).
Tests performed in this cycle are evidenced below, they were a crucial aspect of my development.
1
Run code.
The game to start, boundaries still rendered and player still placed.
As expected
Pass
2
Movement keys: WASD are pressed.
The player is able to move in all directions. This includes the ability to jump.
As expected
Pass
The screen recording below shows the rendered sprite after moving from its original position, it completes the following tasks for this cycle:
The code snippet below shows Javascript for the basic controls used, it completes the following tasks for this cycle:
Utilise basic controls for the movement as specified in .