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

# Slicer

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

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

### Configuration

<details>

<summary>JSON</summary>

```json
{
  "options": {
    "header_background_color": "black",
    "header_text_color": "white",
    "fruits": [
      {
        "name": "apple",
        "points": 5,
        "width": 62,
        "height": 59,
        "minimum_horizontal_speed": 1,
        "maximum_horizontal_speed": 2,
        "minimum_vertical_speed": 4,
        "maximum_vertical_speed": 5,
        "is_a_bomb": 0,
        "img_whole_src": GAME_URL + "/apple-w.png",
        "img_Left_src": GAME_URL + "/apple-l.png",
        "img_Right_src": GAME_URL + "/apple-r.png",
        "img_Stain_src": GAME_URL + "/apple-s.png"
      },
      {
        "name": "peach",
        "points": 5,
        "width": 66,
        "height": 66,
        "minimum_horizontal_speed": 1,
        "maximum_horizontal_speed": 2,
        "minimum_vertical_speed": 4,
        "maximum_vertical_speed": 5,
        "is_a_bomb": 0,
        "img_whole_src": GAME_URL + "/peach-w.png",
        "img_Left_src": GAME_URL + "/peach-l.png",
        "img_Right_src": GAME_URL + "/peach-r.png",
        "img_Stain_src": GAME_URL + "/peach-s.png"
      },
      {
        "name": "strawberry",
        "points": 10,
        "width": 68,
        "height": 72,
        "minimum_horizontal_speed": 1,
        "maximum_horizontal_speed": 2,
        "minimum_vertical_speed": 4,
        "maximum_vertical_speed": 5,
        "is_a_bomb": 0,
        "img_whole_src": GAME_URL + "/strawberry-w.png",
        "img_Left_src": GAME_URL + "/strawberry-l.png",
        "img_Right_src": GAME_URL + "/strawberry-r.png",
        "img_Stain_src": GAME_URL + "/strawberry-s.png"
      },
      {
        "name": "watermelon",
        "points": 1,
        "width": 98,
        "height": 85,
        "minimum_horizontal_speed": 1,
        "maximum_horizontal_speed": 2,
        "minimum_vertical_speed": 4,
        "maximum_vertical_speed": 5,
        "is_a_bomb": 0,
        "img_whole_src": GAME_URL + "/watermelon-w.png",
        "img_Left_src": GAME_URL + "/watermelon-l.png",
        "img_Right_src": GAME_URL + "/watermelon-r.png",
        "img_Stain_src": GAME_URL + "/watermelon-s.png"
      },
      {
        "name": "bomb",
        "points": 0,
        "width": 66,
        "height": 68,
        "minimum_horizontal_speed": 3,
        "maximum_horizontal_speed": 5,
        "minimum_vertical_speed": 4,
        "maximum_vertical_speed": 5,
        "is_a_bomb": 1,
        "img_whole_src": GAME_URL + "/bomb-w.png",
        "img_Left_src": "",
        "img_Right_src": "",
        "img_Stain_src": GAME_URL + "/bomb-s.png"
      }
    ],
    "lives": 3,
    "tutorial_fruit_number": 0,
    "tutorial_bomb_number": 4,
    "min_fruits_per_wave": 1,
    "max_fruits_per_wave": 3,
    "seconds_between_wave": 3,
    "gravity_strenght": 1,
    "height_percent_before_fall_start": 75,
    "cut_trail_width": 5,
    "cut_trail_color": "red",
    "fruit_missed_deduct_lives": false,
    "spawn_bombs": true,
    "fruit_bounce": true,
    "timer": 60,
    "text_police": "Arial",
    "overlay_width": 600,
    "overlay_height": 600
  },
  "texts": {
    "en": {
      "score": "Score",
      "remaining_lives": "✕&nbsp;❤️",
      "time_left": "Time remaining",
      "tutorial_text_1": "Cut fruit to score points.",
      "tutorial_text_2": "Each bomb you cut costs you one life."
    },
    "fr": {
      "score": "Score ",
      "remaining_lives": "✕&nbsp;❤️",
      "time_left": "Temps restant ",
      "tutorial_text_1": "Coupez les fruits pour accumuler les points.",
      "tutorial_text_2": "Chaque bombe coupée vous fais perdre une vie."
    },
    "nl": {
      "score": "Score",
      "remaining_lives": "✕&nbsp;❤️",
      "time_left": "Resterende tijd",
      "tutorial_text_1": "Snijd vruchten om punten te scoren.",
      "tutorial_text_2": "Elke bom die je doorsnijdt kost je een leven."
    }
  },
  "sounds": {},
  "images": {
    "background_image": GAME_URL + "/background.png",
    "tutorial_background_image": GAME_URL + "/tuto-background.png",
    "gameover_image": GAME_URL + "/game-over.png",
    "newgame_circle_image": {
      "en": GAME_URL + "/new-game.png",
      "fr": GAME_URL + "/new-game.png",
      "nl": GAME_URL + "/new-game.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>header_background_color
header_text_color
</code></pre></td><td>String</td><td>Colour / background of the header.</td><td>"black" / "white"</td></tr><tr><td><pre><code>fruits []
</code></pre></td><td>Objects</td><td>Items that will need to be cut in half <em>("is_a_bomb": 0)</em> or not <em>("is_a_bomb": 1)</em>.</td><td>[ {...} ]</td></tr><tr><td><pre><code>lives
</code></pre></td><td>Integer</td><td>Number of lives before game over (= chances to miss).</td><td>3</td></tr><tr><td><pre><code>tutorial_fruit_number
</code></pre></td><td>Integer</td><td>Indicates which item will be displayed in the tutorial as <mark style="color:green;">good</mark>.</td><td>0</td></tr><tr><td><pre><code>tutorial_bomb_number
</code></pre></td><td>Integer</td><td>Indicates which item will be displayed in the tutorial as <mark style="color:orange;">bad</mark>.</td><td>4</td></tr><tr><td><pre><code>min_fruits_per_wave / max_
</code></pre></td><td>Integer</td><td>Amount of items that could be rendered at the same time.</td><td>1 / 3</td></tr><tr><td><pre><code>seconds_between_wave
</code></pre></td><td>Integer</td><td>Delay between each new wave.</td><td>3</td></tr><tr><td><pre><code>gravity_strenght
</code></pre></td><td>Integer</td><td>Strength of the items' gravity (y speed).</td><td>1</td></tr><tr><td><pre><code>height_percent_before_fall_start
</code></pre></td><td>Integer</td><td>Height reached before the items start falling back (in percents).</td><td>75</td></tr><tr><td><pre><code>cut_trail_width
</code></pre></td><td>Integer</td><td>Width of the cursor animation.</td><td>5</td></tr><tr><td><pre><code>cut_trail_color
</code></pre></td><td>String</td><td>Colour of the cursor animation.</td><td>"red"</td></tr><tr><td><pre><code>fruit_missed_deduct_lives
</code></pre></td><td>Boolean</td><td><mark style="color:yellow;">Option</mark> to lose one live if a good item isn't cut before falling back out of the screen.</td><td>false</td></tr><tr><td><pre><code>spawn_bombs
</code></pre></td><td>Boolean</td><td><mark style="color:yellow;">Option</mark> to display bad items in the game (must have bad items in the <em>fruits</em> array).</td><td>true</td></tr><tr><td><pre><code>fruit_bounce
</code></pre></td><td>Boolean</td><td><mark style="color:yellow;">Option</mark> to make items bounce on left and right "walls" (if set to <em>false</em>, will leave the screen).</td><td>true</td></tr><tr><td><pre><code>timer
</code></pre></td><td>Integer</td><td>Duration of the game (in seconds).</td><td>60</td></tr><tr><td><pre><code>text_police
</code></pre></td><td>String</td><td>Font to be used in the game (<em>Google Fonts)</em>.</td><td>"Arial"</td></tr><tr><td><pre><code>overlay_width / _height
</code></pre></td><td>Integer</td><td>Size of the canvas.</td><td>600 / 600</td></tr><tr><td><pre><code>score
</code></pre></td><td>String</td><td>Text in the header.</td><td>"Score"</td></tr><tr><td><pre><code>remaining_lives
</code></pre></td><td>String</td><td>Text in the header.</td><td>"✕&#x26;nbsp;❤️"</td></tr><tr><td><pre><code>time_left
</code></pre></td><td>String</td><td>Text in the header (displayed if no lives).</td><td>"Time remaining"</td></tr><tr><td><pre><code>tutorial_text_1
</code></pre></td><td>String</td><td>Tutorial text for <em>good</em> items.</td><td>"Cut fruit to score points."</td></tr><tr><td><pre><code>tutorial_text_2
</code></pre></td><td>String</td><td>Tutorial text for <em>bad</em> items.</td><td>"Each bomb you cut costs you one life."</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>img_whole_src
img_Left_src
img_Right_src
img_Stain_src
</code></pre></td><td>64 x 64px <em>(whole / left and right must be of the same size)</em><br>100 x 100px <em>(stain)</em></td><td>Visuals of an item.</td><td><a href="https://statics.lucky-cycle.com/files/_games/slicer/apple-w.png">/apple-w.png</a><br><a href="https://statics.lucky-cycle.com/files/_games/slicer/apple-l.png">/apple-l.png</a><br><a href="https://statics.lucky-cycle.com/files/_games/slicer/apple-r.png">/apple-r.png</a><br><a href="https://statics.lucky-cycle.com/files/_games/slicer/apple-s.png">/apple-s.png</a></td></tr><tr><td><pre><code>background_image
</code></pre></td><td>500 x 500px</td><td>Background of the game.</td><td><a href="https://statics.lucky-cycle.com/files/_games/slicer/background.png">/background.png</a></td></tr><tr><td><pre><code>tutorial_background_image
</code></pre></td><td>500 x 500px</td><td>Background of the tutorial.</td><td><a href="https://statics.lucky-cycle.com/files/_games/slicer/tuto-background.png">/tuto-background.png</a></td></tr><tr><td><pre><code>gameover_image
</code></pre></td><td>500 x 500px</td><td>Image displayed at the end of the game.</td><td><a href="https://statics.lucky-cycle.com/files/_games/slicer/game-over.png">/game-over.png</a></td></tr><tr><td><pre><code>newgame_circle_image
</code></pre></td><td>500 x 500px</td><td>Visual to put behind/around the tutorial items.</td><td><a href="https://statics.lucky-cycle.com/files/_games/slicer/new-game.png">/new-game.png</a></td></tr></tbody></table>
