ℹ️ For Yop2D Next, the new 2D + 3D version of Yop2D (coming soon). Button and node names are those of Yop2D Next.
🔍 How do I…? All short recipes, with a search
The hero collects 3 coins. Each coin raises the score; at the third one, the Well done! message appears and the game stops.
You need:
- a 2D project open in Yop2D Next.
Step 1: the hero
- Put an object in the scene (an image or a Square) and name it heros.
- Select heros, tap ⚙ Object behavior in the Inspector and choose Top-down character.
- Tap Object → Interactive → Joystick.
Step 2: the coins
- Put an object in the scene (an image or a Square) and name it piece.
- In the Inspector, Tag (family of objects) line, type piece.
- Add 2 more coins the same way (same piece tag).
Step 3: the victory message
- Tap Object → Texts → Text.
- Name it bravo and type Well done! in its Text line.
- Untick Visible in the game in the Inspector: it is hidden at the start.
Step 4: the score variable
- Left panel, Scene tab, GAME VARIABLES section: tap New variable. Name (no spaces): score; Type: Whole number; Starting value: 0. Then Apply.
Step 5: the nodes
- Open the Blueprint.
- If object touches Tag: Object heros, Tag (family of objects touched) piece
- Destroy Object: Object The involved object (the touched object)
- Add to Variable: Variable score, Value to add 1
- If a variable…: Variable score, Comparison is at least, Value 3
- True output → Visibility (Object bravo, Visible (yes / no) Yes) → Pause the game
The nodes
If object touches Tagheros · piece
→
Destroy ObjectThe involved object (the touched object)
→
Add to Variablescore · 1
→
If a variable…score · is at least 3
If a variable…
True →
Visibilitybravo · Yes
→
Pause the game
Try it
Tap Play and collect the 3 coins: each one disappears, and at the last one Well done! appears.
👉 The involved object (the touched object) = the coin the hero has just touched: one group of nodes works for every coin.