Time for action – add the most important part of any space shooter

We're almost ready to close the book on the main functionality of our space shooter game. We can fire bullets and explodify enemy ships. Although it may well defy the laws of physics, a satisfying fiery explosion occurs in the oxygen-free vacuum of space. But there's just something... missing, yes?

Numerous studies have been conducted to determine the most scientifically accurate sound for a neon-green irradiated bullet being fired through space, and the results have settled unanimously on the onomatopoeic "pew". Luckily, we have just such a sound effect in our Assets folder, so let's get it going.

  1. At the top of the HeroShip Script, declare a variable to hold the "pew" sound effect: ...

Get Unity 4.x Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.