Jetboard Joust Devlog #61 – Flamethrower Blues pt. 2

Another huge lapse of time since the last update. Sorry! I’ve had my head down in contract work, been on holiday, had some private parking scammers issue court proceedings against me and had renovation work to do on a couple of rental properties. I can’t believe it’s been three months!

Contract’s over now though so back to it. I’m determined not to let ‘Jetboard Joust’ become vapourware. This post will be a bit sparse though as I can barely remember what I’ve been doing, it’s been spread over such a long period of time.

In the last post I spoke about getting the basics of the flamethrower action right. Now that was done I needed to make the flamethrower actually have an effect on enemies.

At a basic level this is very simple, I perform a straightforward ‘bounding box’ check on all the flamethrower particles and each enemy. Get the enemy to ‘burn’ in a visually convincing way wasn’t so simple though.

In my first approach I tried ‘sticking’ the flamethrower particles to the enemy once they came in contact. This just looked weird though as all the flames tended to appear in the same place rather than consuming the enemy as one would expect. It also threw up loads of other issues to do with the particles tracking the movement of the flamethrower (see previous post). After a while going down this route my code was starting to look so hacky, and the visuals were still so poor, that I decided to scrap it all and start again.

For my next approach I tried removing the flamethrower particles when they came into contact with an enemy and triggering a ‘burn’ animation instead. Even with a draft ‘burn’ animation this looked much better.

For the ‘burn’ animation itself I created a Flame class that utilised a similar particle effect to the flamethrower particles. After much tweaking I settled on the following ‘burn’ effect: whilst an enemy is burning flames appear at random locations over the enemy. Each flame has a sightly randomized lifespan. Flames may appear in front or behind the enemy, if they appear behind they are placed at the edges of the enemy so as not to be totally obscured from view. When a flame ‘dies’ it is replaced by another at a different location.

Next job was to get the enemy’s health to decrease in a way that made gameplay sense whilst the enemy burnt. I didn’t want health to decrease at the point of impact only, but for this decrease to continue as the ‘burn’ animation played out (to give the impression of the enemy’s health decreasing as they burnt).

What I ended up doing was maintaining a burn_damage variable for each enemy which stores how much it’s health should be depleted by over the course of a burn, and a burn_timer variable which stores the amount of frames the burn animation should last. When the Burn() method is called, burn_damage is increased appropriately and burn_timer set to at least 60 frames (more for very high damage values).

This approach gives a decent ‘slow burn’ effect whilst allowing me to tweak damage values easily to make gameplay sense. I also added something to make the flamethrower particles do less damage the nearer they are to the end of their lifespan.

Dev Time: 2 days
Total Dev Time: approx 119.5 days

previous|next

mockup_3x
The Finished ‘Burn’ Effect

mockup_3x
Enemy Health Depleting On A ‘Slow Burn’

mockup_3x
Flamethrowers At Dawn!

mockup_3x
The Flamethrower Upgrade Icon

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: