My levels rely on having bosses — it’s the culmination of level exploration and the eventual reward for a tougher test of skill. I’ve mentioned this before, and so I need different bosses doing fun-ish things. Of course, each new boss “ability” requires additional logic and work, but hopefully I can build off and reuse existing stuff.
First idea is to have the boss spew a fart acid cloud that the player should actively avoid standing it. It can cover a lot of the playing field, so the player must avoid spreading it everywhere, or they won’t have anywhere to move safely and space to dodge boss’ regular attacks.
So to start, I make my special ability asset:
And I can fill it out with the sort of variables I expect to tweak and change between the three boss phases:
I thought how I would actually activate this “cloud” and I don’t like just spawning it in. What I want is to deliver it somehow from the boss to the player. I could make some special boss ability delivery system, but I already have weapons for mobs and I can already use weapon as part of boss specials. So I’ll just do that — male a cloud spewing weapon and projectile:
Similarly, I need a way to have the cloud actually deliver the damage. I could make a new entity type for this or some new logic in the game world. But I might as well reuse my effect bundles for this as I can already spawn them in, time them, and the acid cloud will need effects anyway:
And I can add the damage entries as part of the effect bundle:
These will run in parallel with effects and will go away when the bundle expires. This extends my bundle a bit, but I think that’s fine even if most sources don’t use this damage stuff.
And this all implemented and wired works out nicely (note the player taking constant damage):
I can also add a custom weapon and projectile sprites for this:
And some flight trail effects:
One issue with this ability is that projectiles can miss. I mean, it’s obvious, but then it’s not what the boss is doing. They are shooting at the player’s location, not the player necessarily. I want the clod to explode where the player was when the boss fired the weapon. Otherwise the projectile misses and hits a wall or something (glitchy sprite order notwithstanding):
To fix this, that I need to pass to the projectile the desired location it should explode at. I also need to specify for my projectile that it should behave as a location-targeted one and not just fly until it hits something or times out.
And this works much better, with the cloud canister exploding where the player actually was, making the gameplay way better:
Okay, let’s do another boss ability. This one will be similar, but the boss will be dropping bombs at the player the explode on a timer.
Again, I will just create a new boss special “bomb launcher” weapon. I can set up all the variables I expect:
First, I need a new bomb prop and that props needs to have an interaction set to be a bomb:
And the projectile for the new weapon needs to spawn this prop when it impact:
So now the boss fires the bombs at the player, same as the gas clouds:
But instead of spawning effects or some such, these spawn the bomb props where they drop:
Now I need to add all the variables for the bomb explosion logic and interaction:
I also want two separate states for the prop – fuse on and off, which is basically the prop blinking a red light:
And with some work, I can implement and wire it all up:
Yay! These looks pretty good even without proper sprites and with barely any tweaks and balancing.
One issue though is that these don’t explode on player proximity, just a timer. I thought it was fine, but the idea is that the player needs to move and cannot stand near the bombs, thus cheesing some of the difficulty by just stacking all the bombs together.
So I think does it for two new boss abilities. These are tricky to do and have a lot of moving parts, even if they don’t require much actual time to implement. In other words, it’s more effort to do these due to so many individual parts that all have to work together and. more importantly, all the previous stuff has to keep on working. It’s hard to understate how much work it is to just make sure the “old stuff” is still all correctly behaving the way it’s supposed to. It would be very easy to make code where changes like this break everything. Thankfully, I am really paying attention to not screw my future self.