Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:tutorials:space-shooter:8-powerups [2021/02/14 23:01]
mannhb [Animating the player]
gdevelop5:tutorials:space-shooter:8-powerups [2021/02/14 23:09] (current)
mannhb [Testing out]
Line 39: Line 39:
 ## Giving extra health to the player ## Giving extra health to the player
  
-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 player's health by 30** and **delete** the powerup object since we do not need it anymore.+We are ready to open the **"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 player's health by 30** and **delete** the powerup object since we do not need it anymore.
  
 <note tip> You can add a comment to classify your events.</note> <note tip> You can add a comment to classify your events.</note>
Line 51: Line 51:
 Go to the **"IsDamaged"** condition and add a new condition to check if the **PowerupShield** variable is **equal to 0**.  Go to the **"IsDamaged"** condition and add a new condition to check if the **PowerupShield** variable is **equal to 0**. 
  
-<note tip> We are going to use this condition to prevent getting damaged while using the powerup</note>+<note tip> We are going to use this condition to prevent getting damaged while using the powerup.</note>
  
 {{ :gdevelop5:tutorials:space-shooter:space-shooter-scale-powerups-min.gif?nolink |}} {{ :gdevelop5:tutorials:space-shooter:space-shooter-scale-powerups-min.gif?nolink |}}
Line 73: Line 73:
 {{ :gdevelop5:tutorials:space-shooter:space-shooter-add-powerup-timer.png?nolink |}} {{ :gdevelop5:tutorials:space-shooter:space-shooter-add-powerup-timer.png?nolink |}}
  
-Finally, we are going to set "**PowerupShield"** and **"IsDamaged"** variables to **0** and **change the animation** of the player to **"PlayerIdle"**We also need to reset the timer called **"PowerupShield"**In the end, your events should look like this:+Finally, we are going to set "**PowerupShield"** and **"IsDamaged"** variables to **0** and **change the animation** of the player to **"PlayerIdle."** We also need to reset the timer called **"PowerupShield."** In the end, your events should look like this:
  
 {{ :gdevelop5:tutorials:space-shooter:space-shooter-chapter-8-events.png?nolink |}} {{ :gdevelop5:tutorials:space-shooter:space-shooter-chapter-8-events.png?nolink |}}
Line 79: Line 79:
 ## Testing out ## Testing out
  
-Before testing out our powerups, we should change the scale of powerup objects just like in the previous cases. Select **Powerups object group** and set scale factor to **1.5**:+Before testing powerups, we should change the scale of powerup objects just like in the previous cases. Select **Powerups object group** and set scale factor to **1.5**:
  
 {{ :gdevelop5:tutorials:space-shooter:space-shooter-scale-powerups.png?nolink |}} {{ :gdevelop5:tutorials:space-shooter:space-shooter-scale-powerups.png?nolink |}}