Score logic
Here is a step-by-step tutorial to add scores to your game
How to add a score logic to my game?
The first step is enabling Scores. Follow the steps below to do that:
- Tap on the menu icon (top-left corner) to open your game menu.
- Tap on Game Rules and enable “Score & Leaderboards”
- Set the score type to ‘Score Points’ and configure the score name as you wish.
Now, the scores are enabled for your game. Let’s use some behavior blocks to handle them.
First Step
The basics for all behaviors
The basics for all behaviors
- Tap on the object to which you want to add a behavior
- With the object selected, tap on the “Details” button to the left of your screen.
- In the Details panel, tap “Add Behavior”.
Second Step
Decide what will trigger the behavior. This could be an action like a collision, an interaction, or players entering a game. Select a “Trigger” box and drag it into the editor.
Third Step
Navigate to the “Game Actions” section. Here, choose the scores block you want your asset to perform when triggered. For example, you might select ‘Add Score’ to add a sense of achievement and motivation after completing something on your game. There is also the ‘Set Score’ node, which sets your score to a specific number instead of increasing (or decreasing, in case you set it to a negative number) the number on it.
Behavior Image
Behavior Image
Fourth Step
Exit the Behavior Editor, playtest and ensure it works as expected!