Devlog 3 - Enemies/Interactions/Puzzles


This week's focus was in-game the in-game enemies. I intended to create sprites, an animation, a very basic AI, add health to both Floptimus and the ghosts, and ensure they can do damage to each other.

The sprite sheet only included two sprites and the animation they create was only intended to play during one state in the ghost animation controller. I created a ghost prefab and added scripts that gave them health which lowered when they came into contact with a 'bark'. I also included a 'broken hearts' animation that played when they took damage. I added similar scripts to Floptimus, except they checked for colliders name 'Ghost' and took damage upon contact.

The ghosts baby AI had four states which controlled which direction they moved and how fast. The wandering state had them moving back and forth without proper intent, but this changed to either 'pursue' or 'flee' when Floptimus' child radius collided with them. The determining factor between the two states was whether Floptimus has jumped an even or odd amount of times, so the player could somewhat control the ghosts reaction but the inevitble need to jump would add a challenge. Assuming the ghost didn't die, if Floptimus' radius stopped making contact, the ghost would think, playing the animation, and then start wandering again. 

One problem I faced was Floptimus' radius counting as a collider which took damage, so Floptimus would unfairly take damage without technically making contact with the ghost. I ended up using a script that detatched the radius from Floptimus within the hierarchy but still made it follow their movements. 

The final set of alterations I made were to the cinemachine camera that followed Floptimus. I needed to set 'world bounds' which prevented the camera from showing outside the level and made some small changes to the camera's daming, speed etc.