Day 14: Galactic Heatwave
Today I created my absolute favorite game feature yet — a secondary fire powerup for my player. The “Heatwave” is a beast of an attack in which the player can emit a ray that explodes every active enemy onscreen for up to five seconds straight. The catch: this powerup will rarely spawn — just about every 60 to 90 seconds — and that can seem like a lifetime in a video game. In my opinion, the scarcity creates more excitement. See the Heatwave in action below.
Programming the Heatwave took a bit of planning and researching. Originally, I planned to create a multi-directional shot, but opted to go for something really dramatic that would temporarily even out the playing field for the player. If the player must fight a seemingly endless wave of enemies, it only seems fair!
To my surprise, what I originally thought would be complicated wasn’t too much of a task. The Heatwave moves and functions similarly to the Laser. The key was to use a tag for the Heatwave to seek out and destroy. In the code below, you’ll see this applies to all objects onscreen tagged “Enemy”.
The last two items on the Phase I checklist include a bar to visualize the charge of the player’s thrusters with a cool down system, and a camera shake effect that occurs every time the player takes damage. I’m nearly through with programming the camera shake, and need to circle back to create the thruster charge bar. An exciting day lies ahead!