1 min
Implementing the player’s other abilities -double jumping, dashing, and changing size.
For the double jump implementaion a current jump count and a max jump count were added to the player class. Then whenever the user pressed space to jump, the jump function in the player class would check if current jump count is less than the max jump count and if then jump and increment current jump count. When the player collides with the ground again current jump count is reset back to 0. To allow the player to double jump max jump count was set from 1 jump to 2.
The implementaion for dashing is fairly simple when the user presses shift and they have the dash ability then the player’s momentum force in the physics component is briefly increased and a timer starts. Once the timer ends the player can dash again.
The user can change their height and width seperatly using the arrow keys with up and down to change height and left and right to change width. I also implemented the ability to chose which direction to grow and shrink in by pressing w, a, s, or d at the same time. Chaning width with this allows the user to move similar to a worm which is an interesting puzzle mechainc.
Subscribe to this blog via RSS.
C++ 30
Directx12 11
Mario kart 11
Commercial games development 15
Unity 15
Low-level programming (19) C++ (30) Text based adventure (5) Ex-machina (9) Game engine programming (11) Directx12 (11) Mario kart (11) Land of gold (5) Audio visual production (1) Commercial games development (15) Unity (15) Don't walk by (15)