We've reached the fifth devlog of my indie shmup game. This time we'll take a look at the initial implementation of multiple enemy types and visual debugging with Swift, SpriteKit and GameplayKit.

Enemy Types

To get a feel for working with different kind of enemies I’ve implemented a few new variations to try out the workflow.

First variation is the non-moving enemy type which represents what will become turrets later on. It still uses the same bullet logic as the original enemy type did.

Then we have another added enemy type which uses the animation component so I could verify that it works as expected. The animation is just a sequence of frames I quickly created in Blender and rendered out so I'd have something to test the code with.

There's now also a basic animation for the player’s bullet to verify that the animation component works as expected for bullets too. Animated bullets will open up for many interesting possibilities as we move forward.

Visual Debugging

Apart from adding enemy types I also implemented some visual debugging helpers. There’s now a debug section in the game’s HUD where I can display relevant data while playing the game that should be helpful to have. Currently I’m tracking the number of entities in the entity component system that is currently active in the game.

On top of that I also added a DebugProtocol for GKComponent which components can implement to visually display debug information when I toggle it on, in a way that is relevant for that particular component. So for instance the movement component implements the debug protocol by displaying the movement as a path. The spawner displays the spawn trigger points. As I keep adding features new components can implement this protocol when relevant.