Devlog #4: Animation, HUD and Enemy Fire in Swift

It's time for the fourth devlog of my shoot'em up game. In this episode I walkthrough my latest implementations regarding animation, HUD and enemy fire in Swift, SpriteKit and GameplayKit.

Devlog #4: Animation, HUD and Enemy Fire in Swift
Johan Steen
by Johan Steen

It's time for the fourth devlog of my shoot'em up game. In this episode I walkthrough my latest implementations regarding animation, HUD and enemy fire in Swift, SpriteKit and GameplayKit.

HUD

The game is moving forward and we now have a basic HUD in place. Visually nothing special but it provides the core functionality of how the HUD shall interact with and render the game data to screen.

Sprite Animation

I've also added a first pass of sprite animation handling with an AnimationComponent. That is a GKComponent which receives the animation frame sequences via a dictionary containing associated animation states.

The implementation is still a bit crude for this component and I'll keep ironing it out as I add animation support for more entities.

Enemy Fire

And at last, but not least, I've added the initial code to allow enemies to start firing bullets so they are now attacking the player. Each enemy bullet is a GKEntity with a MovementComponent. This setup will allow for more advanced enemy bullet patterns moving forward. The bullets are also part of the collision handling so the player takes damage when getting hit.

Discuss this article

The conversation has just started. Comments? Thoughts?

If you'd like to discuss any of the topics covered in this article, then head over and hang out on Discord.

You can also get in touch with me, and keep up with what I'm up to, on Twitter or Mastodon.

Sign up to the newsletter to get occasional emails about my game development.