Project 1: Space Shooter

Making the prototype feel even more like a game

By introducing a power up

From single shot to triple shot and back.

The easiest way to make any game prototype to feel like a game is by having some sort of a collectible. This time it will be a triple shot, that is instead of a single shot being fired three are fired instead.

As a basis for my triple shot I can use my Laser prefab, it already has the basic functionality needed for my triple shot. So all I have to do is to decide where each of these three lasers spawn when shot and add them to a container, which in turn is saved as a prefab.

How to make the new triple shot

Now that the triple shot prefab has been done, the Laser script has to be modified slightly. The only addition there is to check if the laser object has a parent, if yes the parent should be destroyed.

The only change needed for the Laser script was the deletion in case of the triple shot.

After all these, the last changes that I have to make are in the Player script, where I add the new triple shot action to the firing method. For this to work I add a new bool type variable to handle if the triple shot is active or not, this will determine which laser shot is fired single or triple. Of course one shouldn’t forget to instantiate the triple shot as well.

How to determine which to shoot, the triple shot or the single shot laser.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Eero Saarinen

Eero Saarinen

Unity game developer in the making.