Player abilities

Player abilities

Feb 13, 2019. | By: Evan Diamond
1 min

Implementing the player’s other abilities -double jumping, dashing, and changing size.

Double Jump

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.

Dashing

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.

Changing size

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.

About

Gamers developing new games.

Social Links

Our Bunker

University of the West of England,
Frenchay Campus, Bristol, BS16 1QY,
United Kingdom.