Player Movement


This week I developed an early test build of player movement and the associated animations.

The following sprite sheets used for both Wings and Whiskers were obtained from Elthen's Pixel Art Shop (https://elthen.itch.io/). 

Process: 

After experimenting with several character controller scripts, I decided to use a 2D character controller developed by Brackeys (https://github.com/Brackeys/2D-Character-Controller) as a baseline for the movement of both Wings and Whiskers. As opposed to other approaches I had originally considered, the use of this script felt more organised as it handles player movement such as walking, jumping and crouching (not needed) as well as speed, movement smoothing, a "grounded" variable to prevent infinite jumping and an OnLand event which was initially used to operate jumping animations. However, the script does not handle player input which I then implemented in a separate script for simplicity. Additionally, rather than defining the controls directly within the script, I used two different axes in Input Manager (one for arrow keys and another for WASD) which felt cleaner. Further adjustments were made to prevent the characters from sticking to walls and briefly clipping through the floor after jumping.

GIF 1: Idle Animations for Wings and Whiskers

As one of the key features of the game, Whiskers (the ferret) is intended to jump while Wings (the pigeon) is intended to fly. I considered two different approaches to this: an "infinite jump" mechanic (similar to Flappy Bird) or a singular large jump with low gravity. I decided to go with the second approach (GIF 2) as it was not only easier to apply animations to but also provided a limit on how far Wings could fly to prevent future possibilities of leaving the map or breaking the game. Conversely, Whiskers (GIF 3) has a smaller jump with a larger sense of gravity to simulate weight differences (and a lack of wings).

GIF 2: Run and Jump/Fly Animations for Wings

Once player movement felt appropriate for each character, I used the remaining sprites on each sprite sheet to set up the animations for movement and jumping/flying. This was a relatively straightforward process. Originally, I used the OnLand event to cease the jumping animation after it was activated by pressing the jump button, however, there were several issues with this. Wings' animation would only occur briefly until the jump button was re-pressed (as it should ideally loop), while the "landing" component of Whiskers' jumping animation would end abruptly. I fixed this by adding exit time to Whiskers' animation and by checking if Wings was in the air (continuing to loop the animation until this was no longer the case). However, if Whiskers were to jump from a higher platform, the jumping animation would either play twice or "land" midair. I plan to fix this in the future by separating the animation into two different sections so that the landing part will commence upon landing (rather than being cut off). 


GIF 3: Run and Jump Animations for Whiskers

Feedback and Improvements:

My early test build for player movement and animation received very positive feedback primarily regarding the "smoothness"  of the animations and the enjoyment of different jumping heights between the two characters. Additionally, many ideas were suggested regarding possible future interactions between Wings and Whiskers. For example, a mechanic where Wings could temporarily carry Whiskers could be added, though this may be difficult to implement realistically as Whiskers is much larger and heavier.  Many people were also keen for Wings to be able to stand on top of Whiskers. I would like to add this, however, it will need to be done in a way that isn't frustrating or annoying in gameplay (e.g. characters constantly bumping into each other or getting in the way). For example, Wings could ride Whiskers but not the other way around. 

Additionally, once I've made more progress towards level design I would like to add a special ability where Whiskers can interact with particular areas of the map (e.g. a hole in the ground) and will teleport to the other side (or exit of the hole). This will also have its own associated animation. 

As mentioned above, issues with Whiskers' jump animation will also be tweaked in the future.


Brief use of ChatGPT to understand animation issues: https://chatgpt.com/share/680b521e-f70c-8002-be1a-9850ca18a136

Leave a comment

Log in with itch.io to leave a comment.