An optional, level-specific configuation can be provided with the opts in the top level of the level JSON string. Data structure All fields in the opts structure are optional. See the individual Level Option pages for information on each field.
The optional repeat level option defines how many times the entire level should repeat itself before ending. Values -1 The level repeats indefinitely. Use this value for levels that should end only when the player runs out of lives. N > 0 The level repeats N times. Example Level JSON Infinite repititions This spawns bombs…
The optional speed level option defines the game speed multiplier on the default game speed. By default (ie with a speed value of 1), game objects will move at a speed of (0.5 * gameWidth) pixels per second. In other words, an object at GridX=100 will take 2 seconds to reach GridX=0. Values The number…
The optional endPadding level option defines the amount of horizontal space (measured as a GridX value) to append to the end of each spawn chunk or preset. By default, when this option is not specified, an endPadding of 8.89 GridX is added to the end of every chunk. This is about the equivalent of a…
The optional winCriteria level option defines what the game should consider to be a “win” for this level. Regardless of the win criteria, a level will end when the player reaches the end (ie the final spawned object passes by the player) or they lose all of their lives, By default, when this option is…
The optional maxLives level option defines how many lives a player should start with, which is also the maximum amount of lives the player can have even after collecting “extra heart” power-ups. Values options: 1, 2, 3 Example Level JSON maxLives = 1 Game ends immediately after colliding with a bomb maxLives = 3 with…