> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.soba.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# 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:

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

<p align="center">
  <img width="130" noZoom src="https://i.imgur.com/TocBoa7.png" />
</p>

2. Tap on [Game Rules](https://wiki.soba.xyz/creating-your-game/managing-your-game/rules#what-are-game-settings) and enable "Score & Leaderboards”
3. 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](https://wiki.soba.xyz/behavior-editor/general/blocks) to handle them.

<Steps>
  <Step title="First Step">
    <Accordion title="The basics for all behaviors">
      1. Tap on the object to which you want to add a behavior
      2. With the object selected, tap on the “Details” button to the left of your screen.

      <p align="center">
        <img width="200" noZoom src="https://i.imgur.com/jMSZzP8.png" />
      </p>

      3. In the Details panel, tap “Add Behavior”.
    </Accordion>
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.

    <Accordion title="Behavior Image">
      <p align="center">
        <img width="300" noZoom src="https://i.imgur.com/xaSt5j1.png" />
      </p>
    </Accordion>
  </Step>

  <Step title="Fourth Step">
    Exit the Behavior Editor, playtest and ensure it works as expected!
  </Step>
</Steps>
