Snake

Configuration

JSON
{
  "options": {
    "visible_hitbox": false,
    "header_background_color": "black",
    "header_text_color": "white",
    "number_case": 8,
    "spawn": {
      "x": 4,
      "y": 7
    },
    "case_per_second": 1.25,
    "max_case_per_second": 5,
    "acceleration_percent": 10,
    "direction": {
      "url": GAME_URL + "/assets/snake/arrow.png"
    },
    "snake": {
      "direction": "N",
      "url": GAME_URL + "/assets/snake/snake.png"
    },
    "apple": {
      "url": GAME_URL + "/assets/snake/apple.png"
    },
    "background": {
      "url": GAME_URL + "/assets/snake/background.png"
    },
    "tuto": {
      "mobile": GAME_URL + "/assets/snake/tutorial_mobile.gif",
      "desktop": GAME_URL + "/assets/snake/tutorial_desktop.gif"
    },
    "default_lang": "fr"
  },
  "texts": {
    "en": {
      "score": "Score",
      "unit": "Apple(s)"
    },
    "fr": {
      "score": "Score ",
      "unit": "Pomme(s)"
    },
    "nl": {
      "score": "Score",
      "unit": "Appel(s)"
    }
  },
  "images": {
    "rewards": {}
  },
  "sounds": {}
}

Options

Key
Type
Explanation
Default
visible_hitbox

Boolean

[DEV] Display the hitboxes.

false

header_background_color
header_text_color

String

Colour / background of the header.

"black" / "white"

number_case

Integer

Number of cells in a row / column (total cells will be number_cases² as the game is always a square).

8

spawn > x / y

Integer

Indexes of the start cell.

4 / 7

case_per_second

Integer

Base speed.

1.25

max_case_per_second

Integer

Max speed.

5

acceleration_percent

Integer

Acceleration (between 0 and 100).

10

snake > direction

String

Starting direction (could be N, S, E, W).

"N"

default_lang

String

[PTF] Default language if unmatched language.

"fr"

score

String

Text in the header.

"Score"

unit

String

Text in the header.

"Apple(s)"

Assets

Key
Size
Explanation
Default
direction > url

200 x 200px

Arrows (helper) to be displayed on touch screens.

snake > url

(100*sprite) x 100px

Visual of the snake (is a sprite of the snake parts!!).

apple > url

100 x 100px

Visual of the item to retrieve.

background > url

500 x 500px

Background visual.

tuto > mobile / desktop

500 x 500px

Tutorial visual (can be animated, or not).

Last updated