itch.io is community of indie game creators and players

Devlogs

Week 11 - Part 1: Player and enemy movement (week 9)

Isolated
A browser game made in HTML5

This DevLog will focus on creating animation for the players movement and enemy AI pathing for the first enemy, the skeleton.

In the last DevLog I had finished 8-way sprites for both the player and a skeleton along with a small animation for the player being idle with them bobbing up and down. However when changing directions nothing would happen so its time to make the player a bit more interesting!

Player idle animation


To start an animator component was added to the player game object.  Animation clips were made for each of the movement directions. These clips include 3 different positions for each directions, one for central, up and down. The central was used 3 times to create the illusion of moving up and down.

Animation clips

I now needed something to combine all of the branches of the animation clips... that's right, Blend Trees! Using a video tutorial by CouchFerret blend trees weren't so daunting and a position for each of the movements was defined within a new animator state for movement. For example if the player is moving only in the negative-x direction the animation for the player moving west would be played. Vice-versa if the player is moving in the positive-x direction then the animation for moving east would be played. 

Once the blend tree was finished a few lines of code were added to the player movement script so that the blend tree animations would play and the movement shown below now worked as intended.

Leave a comment