Game Progress Update #14

Update #14

Hello world! Well, here we are at the 14th Dev with Dave Game Progress Update.

I know last update I said I had written enough of the UI systems to complete the powerups and boosts, but I had completely overlooked the fact that I hadn’t yet created the Missiles zone, so creating the missile jammer boost effect was unfortunately not possible.

I did however get the Head start and Self destruct boosts working, although neither is as polished as I’d like them to be.

The unlocking boosts works the same way as the unlocking the other powerups, but I had to write some extra code to handle the purchasing of boosts, managing the stock level and updating the text on the Boost store page buttons.

Head Start

The Head Start boost gives the player an initial burst of speed and a shield to protect them for a few seconds.

Code wise, the pre-game section checks to see if the player has a head start boost, and sets the headstart.isActive flag to true.

The main game section checks this flag, and if it’s true then it initialises a head start by setting the variables for the speed# etc. The game then runs at the boosted speed until the duration is up where it slows back down to the normal speed and the shield ends.

It has shown a bug in the way the score is incremented though. The score is supposed to increase faster when the boost is active due to the increased speed of travel. I’ve added this to the Trello and will look into it next time I’m fixing bugs.

Self Destruct

The self destruct boost gives the player an extra burst of speed at the end of a game by exploding and propelling the ship back up into the air.

The force of the explosion and the number of times the players ship bounces is determined by how upgraded the boost is.

Again, implementing the functionality of this boost was a fairly simple case of adding to the existing systems.

I added a check to the PlayerCollision() function to see if the player had a self destruct in stock when they crashed, and if so then move to the self destruct section instead of the usual game over section.

The new self destruct section initialises the self destruct by giving the player a massive boost of yVelocity# which is directly related to the level the self destruct boost is upgraded to.

It uses the same gravity calculation as the other game sections, but instead of triggering the game over when the player hits the floor, it gives the player another boost of yVelocity# as long as the maximum number of bounces hasn’t been exceeded.

The maximum number of bounces is also dependant on the level of the upgrade. Higher levels give more bounces, and therefore more distance and more score.

This will probably have an explosion sound effect, as well as a similar flash effect to the Smart bomb power up, and possibly some extra particle effects as well.

Next time

And that’s that. I’m still kicking myself that I’d forgotten I hadn’t written the missile zone handling system. I also have one other game zone system to write before I have finished all the planned zones and can move on to a bit of level design, creating some more zone sub sets to make the game less repetitive.

On the next update I hope to have not only added the system to handle missile zones to the game, but also have completed the last two boosts!

As always don’t forget to follow @devwithdave on social media if you haven’t already, and I’ll be back in another fortnight with the next exciting game progress update!

See you then

Dave.