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:platformer:part-5 [2020/10/10 06:43]
davidturnbull
gdevelop5:tutorials:platformer:part-5 [2021/11/22 23:06] (current)
Line 1: Line 1:
 # Platformer Tutorial, Part 5: Add Collectible Coins to the Game # Platformer Tutorial, Part 5: Add Collectible Coins to the Game
  
-This part of the [Platformer Tutorial](#explains how to add collectible coins to the game.+This part of the tutorial explains how to add collectible coins to the game.
  
 You'll learn how to: You'll learn how to:
  
 - Delete an object (and play a sound) when a player collides with it. - Delete an object (and play a sound) when a player collides with it.
-- Keep track of data with [variables](#).+- Keep track of data with variables.
 - Add text to a scene. - Add text to a scene.
 +
 +## Series
 +
 +You are reading **Part 5** of the [[gdevelop5:tutorials:platformer:start|Platformer Tutorial]].
 +
 +1. [[gdevelop5:tutorials:platformer:start|Platformer Tutorial, Part 1]]
 +2. [[gdevelop5:tutorials:platformer:part-2|Platformer Tutorial, Part 2]]
 +3. [[gdevelop5:tutorials:platformer:part-3|Platformer Tutorial, Part 3]]
 +4. [[gdevelop5:tutorials:platformer:part-4|Platformer Tutorial, Part 4]]
 +5. Platformer Tutorial, Part 5
 +6. [[gdevelop5:tutorials:platformer:part-6|Platformer Tutorial, Part 6]]
 +7. [[gdevelop5:tutorials:platformer:part-7|Platformer Tutorial, Part 7]]
 +8. [[gdevelop5:tutorials:platformer:part-8|Platformer Tutorial, Part 8]]
 +
  
 ## Step 1: Create a collectible coin ## Step 1: Create a collectible coin
Line 21: Line 35:
 {{:gdevelop5:tutorials:platformer:05-01-coin-object.jpg|}} {{:gdevelop5:tutorials:platformer:05-01-coin-object.jpg|}}
  
-**Note:** To duplicate a coin that's already in the scene, hold down the `CTRL` key (or `CMD` on macOS). Then select and drag an instance of the coin.+<note>To duplicate a coin that's already in the scene, hold down the `CTRL` key (or `CMD` on macOS). Then select and drag an instance of the coin.</note>
  
 ### Make the coin collectible ### Make the coin collectible
Line 38: Line 52:
 ## Step 2: Keep track of the collected coins ## Step 2: Keep track of the collected coins
  
-Every time a user collects a coin, the game needs to keep track of the number of coins the player has collected. To do this, the game needs a *variable*.+Every time a user collects a coin, the game needs to keep track of the number of coins the player has collected. To do this, the game needs a [[gdevelop5:all-features:variables|variable]].
  
 A variable is a container that can store data. If you've ever done algebra, then you're familiar with variables, as letters like "x" and "y" are often used as variables. A variable is a container that can store data. If you've ever done algebra, then you're familiar with variables, as letters like "x" and "y" are often used as variables.
Line 77: Line 91:
 ### Update the "Score" object with the number of collected coins ### Update the "Score" object with the number of collected coins
  
-Before you can update the rendered text with the number of collected coins, it's important to have a broad understanding of *expressions*.+Before you can update the rendered text with the number of collected coins, it's important to have a broad understanding of [[gdevelop5:expressions|expressions]].
  
 In GDevelop, expressions are similar to spreadsheet formulas or functions in a programming language. You can pass a value into an expression and receive a value. In GDevelop, expressions are similar to spreadsheet formulas or functions in a programming language. You can pass a value into an expression and receive a value.
Line 108: Line 122:
  
 {{:gdevelop5:tutorials:platformer:05-06-score-preview.gif|}} {{:gdevelop5:tutorials:platformer:05-06-score-preview.gif|}}
 +
 +<note tip>You can find more //expressions// in the //expression editor// by clicking on the blue icon next to the value fields:
 +
 +{{ :gdevelop5:tutorials:platform-game:expression-icon.png?nolink |}}
 +
 +When you click the blue icon, you can search all the available expressions sorted into categories.
 +
 +{{ :gdevelop5:tutorials:platform-game:expression-editor.png?nolink |}}
 +</note>
  
 ### Move the text to a different layer ### Move the text to a different layer
Line 129: Line 152:
 ## Next step ## Next step
  
-Read [Platformer Tutorial, Part 6](#)+Read [[gdevelop5:tutorials:platformer:part-6|Platformer Tutorial, Part 6]].