Player Appearance - UQdeco2800/2021-studio-6 GitHub Wiki
Descriptions
The player appearance is an integral part of the player character and encompasses several aspects.
Player Sprite Design
The character and colour scheme
The player is created with a pixel art style. Corresponding to the game theme of escaping the darkness, the colour scheme of the player sprite is in grey-blue and grey-green. Also, the player sprite is designed to be small and vulnerable. This colour scheme can create a dim and cold feeling and the character is designed to be powerless, which meets the goal of utilising the sense of fear and simulating the motivation of playing the game.
Detailed design for animations
When the character being attacked, it will turn red. The changing from a grey tone to a high-saturation red will motivate the user to attack back.
Armour design
The armour is design in two tiers, which provides the player with different protective capabilities. The first tier is the helmet, the second tier adds on a suit.
PlayerAnimationController overview
The basis of player animation is found in the new PlayerAnimationController class. This should contain all the relevant methods to handle player animations. In the create() method, an event listener is created and attached to each animation method in the class to ensure the proper animation gets called. Additionally, an event trigger must then be added to wherever the event occurs. This will typically be in KeyboardPlayerInputComponent as most animations will play after an action, such as movement or dashing. Additionally, the animation files themselves (.atlas files) must be added to the PlayerFactor in the AnimationRenderComponent. This setup allows new player animations to be added quickly and seamlessly.
Directions for new Animation:
- Add animation file to PlayerFactor in AnimationRenderComponent
- Create void animateAction function in PlayerAnimationController that starts the animation
- Add an event listener in the create() method of PlayerAnimationController to call the animateAction function
- Add an event trigger to wherever the action occurs
Directional Sprites/Animations
This is designed to replicate dynamic and fluid character movement by altering the player appearance based on movement. As it stands, this is simply changing the player animation/sprite depending on which direction the player is moving. i.e. If the player is moving to the left, an animation plays to show the character moving in that direction.
Methods:
void animateLeft/Right/Up/Down(): A set of four void methods will be created, one for each direction. These methods have event listeners attached to them in the create() method. Upon being called, they start the appropriate animation for the direction as specified by the startAnimation name in the method. This name refers to animations added in the PlayerFactory createPlayer() method, as outlined in PlayerAnimationController overview.
void animateStill(): A fifth function will facilitate the player's appearance for when they are remaining still and will be defaulted back to when the player stops moving. Similar to the previous methods, an event listener will be used to detect this state.