Dino Run

Configuration

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,
    "default_lang": "fr",
    "reset_button": false
  },
  "texts": {
    "en": {
      "start": "Play now",
      "unit": "m"
    },
    "fr": {
      "start": "Je joue",
      "unit": "m"
    },
    "nl": {
      "start": "Speel nu",
      "unit": "m"
    }
  },
  "sounds": {},
  "images": {
    "obstacles": [
      GAME_URL + "/assets/dino-run/obstacle-large.png",
      GAME_URL + "/assets/dino-run/obstacle-small.png"
    ],
    "clouds": [
      GAME_URL + "/assets/dino-run/cloud.png"
    ],
    "horizon": GAME_URL + "/assets/dino-run/horizon.png",
    "trex": GAME_URL + "/assets/dino-run/trex.png",
    "rewards": {}
  }
}

Options

Key
Type
Explanation
Default
speed

Int

Base speed.

180

acceleration

Float

Acceleration.

0.01

jump

Int

Jump force (from ground level, same unit).

25 (%)

gravity

Int

Gravity strength.

130

ground

Int

Ground level (from the top of the game).

85 (%)

sky

Int

Sky level (from the top of the game).

10 (%)

clouds

Int

Number of clouds.

3

obstacles

Int

Number of obstacles (warning: if 0 the game becomes endless).

2

obstaclesSprites

Int

Number of sprites on obstacles (must be the same for every visual!).

6

obstaclesMaxSprites

Int

Maximum width of an obstacle (min should be 1, or endless).

3

obstaclesMinDistance

Int

Minimal distance between two obstacles (must be spread enough to allow a jump between two obstacles).

40 (%)

trexSprites

Int

Number of sprite for the runner (should have multiple, see visual specs!).

6

hitboxSize

Int

Percentage of the visual to be used for hitbox calculation (100% = whole image, 0% = no hitbox, endless game).

65 (%)

default_lang

String

[PTF] Default language if unmatched language.

"fr"

reset_button

Boolean

[PTF] Set to true to cancel button's style.

false

text > start

String

Start button's text.

"Play now" / "Je joue" / "Speel nu"

text > unit

String

Game unit (displayed with the score).

"m"

Assets

Key
Size
Explanation
Default
obstacles

150 (6*25) x 50px

Visual(s) used for the obstacles, can be displayed partially.

clouds

50 x 15px

Visual(s) used for the clouds.

horizon

1200 x 12px

Visual used for the horizon line.

trex

264 (6*44) x 50 px

Visual used for the runner. Should have multiple sprites (idle state, jumping up, jumping down).

Last updated