Devlog #8: Animation States & Paths

In this episode the animation component has been improved and can handle more advanced states with associated logic as well as entity orientation. The first iteration of a path editor prototyped in Xcode playgrounds is introduced.

Animation States

Animation states in the animation component are now more flexible and can be used in more advanced ways.

In the devlog I walk through a new turret entity that has two layers of animation, a background animation with a separate animation on top that opens and closes the doors and applies firing logic depending on animation state. This example use sprite atlases so it is pure frame based.

Another variation of the turret is also in the episode where the turret has a separate layer that rotates and aim before firing a sequence of bullets.

Orientation

The other improvement showcased in this episode is animation based on logical orientation.

Previously the entities just followed a path, but now the animation component can add a visual orientation on top of that.

What makes this a tad interesting is that I've implemented a combination of rotating the actual sprite together with baked animation frames, so I can get smooth rotation while still getting some lighting effects on the actual graphics.

Entity behavior

In the devlog there's an early version of an entity with a chase behavior where the enemy can chase the player and the player can also escape if getting enough distance from the enemy.

At this time I don't use GamePlayKit with GKAgent for this, it's just plain basic trigonometry math. But I might explore GKAgents later on.

With more polish this could turn out to be an interesting enemy type in the game.

Xcode Playgrounds Path Editor

And finally I coded a rough path editor so I could start applying more interesting movement patterns to the entities.

I used Xcode playgrounds to quickly prototype the path editor with SpriteKit. Playgrounds is an excellent environment to prototype new features within an isolated space, before adding it to the real code base.

Game Devlog

This is the eighth episode of my devlog following the progress of my indie game, which is a top down shoot'em up, that I am coding in Swift on top of the SpriteKit and GameplayKit frameworks.

Enjoy.