> For the complete documentation index, see [llms.txt](https://doc.lucky-cycle.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.lucky-cycle.com/games/index/endless.md).

# Endless Runner

{% hint style="warning" %}
Demo: <https://campaigns.lucky-cycle.com/utils/games?game=endless>
{% endhint %}

1. [#configuration](#configuration "mention")
2. [#options](#options "mention")
3. [#assets](#assets "mention")

### Configuration

<details>

<summary>JSON</summary>

```json
{
  "options": {
    "visible_hitbox": false,
    "background": {
      "current_stage": 0,
      "speed": 5,
      "cap_speed": 10,
      "acceleration": 0.3,
      "change_stage_after_x_screens": 13
    },
    "runner": {
      "image": GAME_URL + "/runner.png",
      "position_y": 380,
      "position_x": [
        113,
        223,
        338
      ],
      "position_init": 1,
      "width": 100,
      "height": 120,
      "sprites_count": 8,
      "hitbox": {
        "x": 40,
        "y": 45,
        "width": 20,
        "height": 35
      }
    },
    "stages": [
      {
        "image": GAME_URL + "/background-world2.jpg",
        "obstacles": {
          "position_x": [
            115,
            228,
            345
          ],
          "sprites_count": 6,
          "width": 90,
          "height": 90,
          "image": GAME_URL + "/obstacles-world2.png"
        },
        "sides": {
          "sprites_count": 10,
          "width": 120,
          "height": 120,
          "image": GAME_URL + "/sides-world2.png"
        }
      },
      {
        "image": GAME_URL + "/background-world1.jpg",
        "obstacles": {
          "position_x": [
            115,
            228,
            345
          ],
          "sprites_count": 7,
          "width": 90,
          "height": 90,
          "image": GAME_URL + "/obstacles-world1.png"
        },
        "sides": {
          "sprites_count": 9,
          "width": 120,
          "height": 120,
          "image": GAME_URL + "/sides-world1.png"
        }
      },
      {
        "image": GAME_URL + "/background-world3.jpg",
        "obstacles": {
          "position_x": [
            115,
            228,
            345
          ],
          "sprites_count": 6,
          "width": 90,
          "height": 90,
          "image": GAME_URL + "/obstacles-world3.png"
        },
        "sides": {
          "sprites_count": 10,
          "width": 120,
          "height": 120,
          "image": GAME_URL + "/sides-world3.png"
        }
      }
    ]
  },
  "texts": {
    "en": {
      "unit": "m"
    },
    "fr": {
      "unit": "m"
    },
    "nl": {
      "unit": "m"
    }
  },
  "sounds": {},
  "images": {
    "tutorial": {
      "en": GAME_URL + "/tutorial-en.gif",
      "fr": GAME_URL + "/tutorial-fr.gif",
      "nl": GAME_URL + "/tutorial-nl.gif"
    },
    "rewards": {}
  }
}
```

</details>

### Options

<table><thead><tr><th>Key</th><th>Type</th><th>Explanation</th><th>Default</th></tr></thead><tbody><tr><td><pre><code>visible_hitbox
</code></pre></td><td>Boolean</td><td><mark style="color:purple;">[DEV]</mark> Display the runner's hitbox.</td><td>false</td></tr><tr><td><pre><code>background > current_stage
</code></pre></td><td>Integer</td><td>Index of the starting  "stage".</td><td>0</td></tr><tr><td><pre><code>background > speed
</code></pre></td><td>Integer</td><td>Base speed.</td><td>5</td></tr><tr><td><pre><code>background > cap_speed
</code></pre></td><td>Integer</td><td>Max speed.</td><td>10</td></tr><tr><td><pre><code>background > acceleration
</code></pre></td><td>Float</td><td>Acceleration.</td><td>0.3</td></tr><tr><td><pre><code>background > change_stage_after_x_screens
</code></pre></td><td>Integer</td><td>Number of stages' passes before switching to the next one (if more than one in the array).</td><td>13</td></tr><tr><td><pre><code>runner
</code></pre></td><td>Object</td><td><mark style="color:red;">Visual + config of the player.</mark></td><td>{ ... }</td></tr><tr><td><pre><code>stages
</code></pre></td><td>Objects</td><td><mark style="color:red;">Visuals + config of the stages.</mark></td><td>[ {...} ]</td></tr><tr><td><pre><code>unit
</code></pre></td><td>String</td><td>Unit of the game (points, meters, etc.).</td><td>"m"</td></tr></tbody></table>

### Assets

<table><thead><tr><th>Key</th><th>Size</th><th>Explanation</th><th>Default</th></tr></thead><tbody><tr><td><pre><code>tutorial
</code></pre></td><td>500 x 500px</td><td>Visual (can be animated) displayed for a few seconds at the start of the game.</td><td><a href="https://statics.lucky-cycle.com/files/_games/endless/tutorial-en.gif">/tutorial-en.gif</a></td></tr><tr><td><pre><code>runner > image
</code></pre></td><td>120 <mark style="color:yellow;">(* nb of frames)</mark> x 120px</td><td>Visual of the runner <mark style="color:yellow;">(must be frames to be animated)</mark>.</td><td><a href="https://statics.lucky-cycle.com/files/_games/endless/runner.png">/runner.png</a></td></tr><tr><td><pre><code>stages > image
</code></pre></td><td>550 x 700px</td><td>Background of the stage.</td><td><a href="https://statics.lucky-cycle.com/files/_games/endless/background-world2.jpg">/background-world2.jpg</a></td></tr><tr><td><pre><code>stages > obstacles > image
</code></pre></td><td>90 <mark style="color:yellow;">(* nb of items)</mark> x 90px</td><td>Sprite of the obstacles.</td><td><a href="https://statics.lucky-cycle.com/files/_games/endless/obstacles-world2.png">/obstacles-world2.png</a></td></tr><tr><td><pre><code>stages > sides > image
</code></pre></td><td>120 <mark style="color:yellow;">(* nb of items)</mark> x 120px</td><td>Sprite of the side visuals.</td><td><a href="https://statics.lucky-cycle.com/files/_games/endless/sides-world2.png">/sides-world2.png</a></td></tr></tbody></table>
