<Index> - >DevDiary< - <Characters> - <Lore>
This week, I briefly worked on the enemy attacks. Almost every enemy in the game uses projectiles to attack Pawn, and so I began working on the code for spawning, moving, hitting and despawning projectiles.
The first enemy that was made for the old version of the game was the Spider, and as such it is the only enemy in the game whose visuals do not share a motif with its attacks. The Spider is a very basic enemy type, as I just needed an entity that behaves like a generic enemy and looks like a generic enemy.
Like with every enemy in the game, the Spider's behavior is supposed to change depending on the chosen difficulty, but these changes are already covered by the basic properties of projectiles. For now, I carried over the Easy Mode version of Spider from SD2020 to SDR. It only shoots one small projectile per second, aiming at Pawn's current location.
Since the Spider needs to know where Pawn is, I had to make sure the game properly handles exceptional situations - for example, if Pawn spontaneously ceases to exist, nothing should break. This reinforcement of code that takes spontaneous loss of reference objects into account is vital to both the stability of the finished product and the ease of development process, as the example above now lets me despawn Pawn spontaneously on my own, without worrying that it might break something else or crash the entire game.
Pawn deflecting a projectile from a Spider in SDR.
What I have to do now is give Pawn the ability to reflect the projectiles like in SD2020, as well as port all other enemies, including the difficulty-based behavior changes. At this rate, SDR will reach the proof of concept stage by the time I write the next DevDiary entry.
The unofficial theme song of the SD Spider is "Dark Side of Fate" (「運命のダークサイド」), inspired by the fact that the best strategy to counter a swarm of Spiders is to keep spinning.