> 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/dino-run.md).

# Dino Run

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

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

### Configuration

<details>

<summary>JSON</summary>

```json
{
  "options": {
    "speed": 180,
    "acceleration": 0.01,
    "jump": 25,
    "gravity": 130,
    "ground": 85,
    "sky": 10,
    "clouds": 3,
    "obstacles": 2,
    "obstaclesSprites": 6,
    "obstaclesMaxSprites": 3,
    "obstaclesMinDistance": 40,
    "trexSprites": 6,
    "hitboxSize": 65,
    "debug": false
  },
  "texts": {
    "en": {
      "start": "Play now",
      "unit": "m"
    },
    "fr": {
      "start": "Je joue",
      "unit": "m"
    },
    "nl": {
      "start": "Speel nu",
      "unit": "m"
    }
  },
  "images": {
    "obstacles": [
      GAME_URL + "/obstacle-large.png",
      GAME_URL + "/obstacle-small.png"
    ],
    "clouds": [
      GAME_URL + "/cloud.png"
    ],
    "horizon": GAME_URL + "/horizon.png",
    "ground": "",
    "trex": GAME_URL + "/trex.png",
    "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>speed
</code></pre></td><td>Int</td><td>Base speed.</td><td>180</td></tr><tr><td><pre><code>acceleration
</code></pre></td><td>Float</td><td>Acceleration.</td><td>0.01</td></tr><tr><td><pre><code>jump
</code></pre></td><td>Int</td><td>Jump force (from ground level, same unit).</td><td>25 (%)</td></tr><tr><td><pre><code>gravity
</code></pre></td><td>Int</td><td>Gravity strength.</td><td>130</td></tr><tr><td><pre><code>ground
</code></pre></td><td>Int</td><td>Ground level (from the top of the game).</td><td>85 (%)</td></tr><tr><td><pre><code>sky
</code></pre></td><td>Int</td><td>Sky level (from the top of the game).</td><td>10 (%)</td></tr><tr><td><pre><code>clouds
</code></pre></td><td>Int</td><td>Number of clouds.</td><td>3</td></tr><tr><td><pre><code>obstacles
</code></pre></td><td>Int</td><td>Number of obstacles <mark style="color:red;">(warning: if 0 the game becomes endless)</mark>.</td><td>2</td></tr><tr><td><pre><code>obstaclesSprites
</code></pre></td><td>Int</td><td>Number of sprites on obstacles <mark style="color:yellow;">(must be the same for every visual!)</mark>.</td><td>6</td></tr><tr><td><pre><code>obstaclesMaxSprites
</code></pre></td><td>Int</td><td>Maximum width of an obstacle <mark style="color:red;">(min should be 1, or endless)</mark>.</td><td>3</td></tr><tr><td><pre><code>obstaclesMinDistance
</code></pre></td><td>Int</td><td>Minimal distance between two obstacles <mark style="color:yellow;">(must be spread enough to allow a jump between two obstacles)</mark>.</td><td>40 (%)</td></tr><tr><td><pre><code>trexSprites
</code></pre></td><td>Int</td><td>Number of sprite for the runner <mark style="color:yellow;">(should have multiple, </mark><em><mark style="color:yellow;">see visual specs</mark></em><mark style="color:yellow;">!)</mark>.</td><td>6</td></tr><tr><td><pre><code>hitboxSize
</code></pre></td><td>Int</td><td>Percentage of the visual to be used for <em>hitbox</em> calculation <em>(100% = whole image, <mark style="color:red;">0% = no hitbox, endless game</mark>)</em>.</td><td>65 (%)</td></tr><tr><td><pre><code>default_lang
</code></pre></td><td>String</td><td><mark style="color:yellow;">[PTF]</mark> Default language if unmatched language.</td><td><mark style="color:red;">"fr"</mark></td></tr><tr><td><pre><code>reset_button
</code></pre></td><td>Boolean</td><td><mark style="color:yellow;">[PTF]</mark> Set to <em>true</em> to cancel button's style.</td><td>false</td></tr><tr><td><pre><code>text > start
</code></pre></td><td>String</td><td>Start button's text.</td><td>"Play now" / "Je joue" / "Speel nu"</td></tr><tr><td><pre><code>text > unit
</code></pre></td><td>String</td><td>Game unit (displayed with the score).</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>obstacles
</code></pre></td><td>150 <em>(6*25)</em> x 50px</td><td>Visual<mark style="color:blue;">(s)</mark> used for the obstacles, can be displayed <em>partially</em>.</td><td><a href="https://statics.lucky-cycle.com/files/_games/dino-run/obstacle-large.png">/obstacle-large.png</a></td></tr><tr><td><pre><code>clouds
</code></pre></td><td>50 x 15px</td><td>Visual<mark style="color:blue;">(s)</mark> used for the clouds.</td><td><a href="https://statics.lucky-cycle.com/files/_games/dino-run/cloud.png">/cloud.png</a></td></tr><tr><td><pre><code>horizon
</code></pre></td><td>1200 x 15px</td><td>Visual used for the sky (above runner).</td><td><a href="https://statics.lucky-cycle.com/files/_games/dino-run/horizon.png">/horizon.png</a></td></tr><tr><td><pre><code>ground
</code></pre></td><td>1200 x 15px</td><td>Visual used for the ground (below runner).</td><td>/</td></tr><tr><td><pre><code>trex
</code></pre></td><td>270 <em>(6*45)</em> x 50 px</td><td>Visual used for the runner. Should have multiple sprites <mark style="color:orange;">(idle state, jumping up, jumping down)</mark>.</td><td><a href="https://statics.lucky-cycle.com/files/_games/dino-run/trex.png">/trex.png</a></td></tr></tbody></table>
