Project 1: Space Shooter
Making the prototype feel even more like a game
By introducing a power up
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.
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.
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.