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

# Penalty

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

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

### Configuration

<details>

<summary>JSON</summary>

```json
{
  "options": {
    "game_square": 450,
    "game_margin": 25,
    "min_aspect_ratio": "600 / 500",
    "number_of_shoot": 5,
    "time_between_shoot": 1000,
    "background": {
      "url": GAME_URL + "/background.png",
      "height": 960,
      "width": 1100
    },
    "ball": {
      "url": GAME_URL + "/ball.png",
      "height": 50,
      "width": 50,
      "speed": 120
    },
    "keeper": {
      "url": GAME_URL + "/keeper.png",
      "height": 126,
      "width": 103,
      "offsetY": 10,
      "speed": {
        "min": 2,
        "max": 7,
        "step": 1
      }
    },
    "goal": {
      "url": GAME_URL + "/goal.png",
      "height": 310,
      "width": 575,
      "offsetY": -87,
      "goal_post_angle": 0.12
    },
    "board": {
      "url": GAME_URL + "/board.png",
      "ratio": "628 / 336",
      "text_color": "white",
      "background_color": "black",
      "progress": true,
      "score": true,
      "goal_emoji": "⚽",
      "miss_emoji": "❌",
      "unset_emoji": "⚪"
    },
    "visor": {
      "color": "white"
    }
  },
  "texts": {
    "en": {
      "shoot": "Shots: ",
      "score": "Goals: "
    },
    "fr": {
      "shoot": "Tirs : ",
      "score": "Buts : "
    },
    "nl": {
      "shoot": "Kicks: ",
      "score": "Goals: "
    }
  },
  "sounds": {},
  "images": {
    "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>game_square
</code></pre></td><td>Integer</td><td>Actual game zone.</td><td>450</td></tr><tr><td><pre><code>game_margin
</code></pre></td><td>Integer</td><td>Border around the game zone.</td><td>25</td></tr><tr><td><pre><code><strong>min_aspect_ratio
</strong></code></pre></td><td>String</td><td>Aspect ratio to be used <em>if no parent sizing is provided</em>.</td><td>"600 / 500"</td></tr><tr><td><pre><code>number_of_shoot
</code></pre></td><td>Integer</td><td>Number of times a player can "shoot" the ball.</td><td>5</td></tr><tr><td><pre><code>time_between_shoot
</code></pre></td><td>Integer</td><td>Delay between each "shoot".</td><td>1000</td></tr><tr><td><pre><code>background > height / width
</code></pre></td><td>Integer</td><td>Background's visual sizes.</td><td>960 / 1100</td></tr><tr><td><pre><code>ball > height / width
</code></pre></td><td>Integer</td><td>Ball's visual sizes (to render).</td><td>50 / 50</td></tr><tr><td><pre><code>ball > speed
</code></pre></td><td>Integer</td><td>Speed of the ball.</td><td>120</td></tr><tr><td><pre><code>keeper > height / width
</code></pre></td><td>Integer</td><td>Keeper's visual sizes (to render).</td><td>126 / 103</td></tr><tr><td><pre><code>keeper > offsetY
</code></pre></td><td>Integer</td><td>Vertical adjustment of the keeper.</td><td>10</td></tr><tr><td><pre><code>keeper > speed > min / max
</code></pre></td><td>Integer</td><td>Speed of the keeper (min and max, increases after each "goal").</td><td>2 / 7</td></tr><tr><td><pre><code>keeper > speed > step
</code></pre></td><td>Integer</td><td>Speed increasing after each "goal".</td><td>1</td></tr><tr><td><pre><code>goal > height / width
</code></pre></td><td>Integer</td><td>Goal's visual sizes (to render).</td><td>310 / 575</td></tr><tr><td><pre><code>goal > offsetY
</code></pre></td><td>Integer</td><td>Vertical adjustment of the goal.</td><td>-87</td></tr><tr><td><pre><code>goal > goal_post_angle
</code></pre></td><td>Number</td><td>Border for the goal (the ball will <strong>bounce</strong> of those areas).</td><td>0.12</td></tr><tr><td><pre><code>board > ratio
</code></pre></td><td>String</td><td>Size ratio of the scoreboard visual.</td><td>"628 / 336"</td></tr><tr><td><pre><code>board > text_color / background_color
</code></pre></td><td>String</td><td>Colors of the menu (if no <strong>scoreboard visual</strong> is provided).</td><td>"white" / "black"</td></tr><tr><td><pre><code>board > progress
</code></pre></td><td>Boolean</td><td>Display the current progress of the game.</td><td>true</td></tr><tr><td><pre><code>board > score
</code></pre></td><td>Boolean</td><td>Display the current score of the game.</td><td>true</td></tr><tr><td><pre><code><strong>board > goal_emoji
</strong></code></pre></td><td>String</td><td>Replace the default <em>text</em> progress, with icons.</td><td>"⚽" / "❌" / "⚪"</td></tr><tr><td><pre><code>visor > color
</code></pre></td><td>String</td><td>Color of the curve preview (<em>transparent</em> to remove it).</td><td>"white"</td></tr><tr><td><pre><code>shoot
</code></pre></td><td>String</td><td>Text displayed in the header.</td><td>"Shots: "</td></tr><tr><td><pre><code>score
</code></pre></td><td>String</td><td>Text displayed in the header.</td><td>"Goals: "</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>background > url
</code></pre></td><td>~600 x 600px <mark style="color:yellow;">(adapt </mark><em><mark style="color:yellow;">background</mark></em><mark style="color:yellow;"> sizes)</mark></td><td>Background of the game.</td><td><a href="https://statics.lucky-cycle.com/files/_games/penalty/background.png">/background.png</a></td></tr><tr><td><pre><code>ball > url
</code></pre></td><td>50 x 50px</td><td>Visual of the ball.</td><td><a href="https://statics.lucky-cycle.com/files/_games/penalty/ball.png">/ball.png</a></td></tr><tr><td><pre><code>keeper > url
</code></pre></td><td>~100 x 125px <mark style="color:yellow;">(adapt </mark><em><mark style="color:yellow;">keeper</mark></em><mark style="color:yellow;"> sizes)</mark></td><td>Visual of the keeper.</td><td><a href="https://statics.lucky-cycle.com/files/_games/penalty/keeper.png">/keeper.png</a></td></tr><tr><td><pre><code>goal > url
</code></pre></td><td>~400 x ...px <mark style="color:yellow;">(adapt </mark><em><mark style="color:yellow;">goal</mark></em><mark style="color:yellow;"> sizes)</mark></td><td>Visual of the goal.</td><td><a href="https://statics.lucky-cycle.com/files/_games/penalty/goal.png">/goal.png</a></td></tr><tr><td><pre><code>board > url
</code></pre></td><td>~400 x 200px <mark style="color:yellow;">(adapt </mark><em><mark style="color:yellow;">board</mark></em><mark style="color:yellow;"> sizes)</mark></td><td>Visual of the scoreboard.</td><td><a href="https://statics.lucky-cycle.com/files/_games/penalty/board.png">/board.png</a></td></tr></tbody></table>
