How to add a score logic to my game?

The first step is enabling Scores. Follow the steps below to do that:

  1. Tap on the menu icon (top-left corner) to open your game menu.

  1. Tap on Game Rules and enable “Score & Leaderboards”
  2. 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.

1

First Step

2

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.

3

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.

4

Fourth Step

Exit the Behavior Editor, playtest and ensure it works as expected!