To have a nice looking powerup, I head to Filebase folder and pick the sprite for the triple shot power, let’s call the object Triple_Shot_Powerup. Once I have that added to my Scene view, I can attach the Rigidbody2D and the BoxCollider2D for it as well. Remember to tick the Is Trigger box, and set the gravity to zero.
Then comes the script. Basically nothing new here, once the powerup has been instantiated it moves down and if it collides with the player it will be destroyed after giving the player the powerup. Also once the powerup has dropped off screen it will be destroyed.
I just have to add the method called TripleShotActive in my Player script, and make it change the _isTripleShotActive to “true from the default “false, and start a coroutine which changes the _isTripleShotActive back to false after five seconds. For testing purposes this suffices.
What about the animation stuff? Once I have selected my Triple_Shot_Powerup, I can bring up an animation view with “ctrl+6. Once that is open, all I have to do is to hit the record button and drag and drop the powerup sprites provided by GameDevHQ. And when I’m finished, I can stop the recording from the same button. By pushing the play button, I can see the animation in the Scene view.
Now all that is left is to add my Triple_Shot_Powerup to Prefabs and test it out. Maybe that’s a bit too many…