**This is an old revision of the document!**

8. Powerups


Adding powerups

We will add two objects called “PowerupHealth”, and “PowerupShield”. Select the “powerup_health.png” image from the assets folder for the health object. Repeat the same process for shield object by choosing the “powerup_shield.png” image. In the end, you should see:

Then create an object group called “Powerups”.

Animating the player

We are using animations to change the sprite of the player when the player collides with PowerupShield. Open the properties panel of the player, and enter “PlayerIdle” in Animation#0. Then add a new animation called “PlayerShield”, and select “player_shield.png” from the assets folder.

Giving extra health

We are ready to open “Events” page. We will add a new condition to check the collision between the Player and the PowerupHealth objects. If the collision happens, we want to increase the health of the player by 30 and delete the powerup object since we do not need it anymore.

You can add a comment to classify your events.

Create a new scene variable called “PoweupShield” to prevent getting any damage while using this powerup.

Testing out

Before testing out the meteors, we should put some meteor objects on the scene. Drag and drop some meteor items on the scene.

Run the game. Now you can see the meteors on the scene. If you hit some meteors, you will get damage.