This represents aย wave of Coin objectsย (which from the game’s perspective may be either a coin or gem).
The Coin objects are arranged in a sine wave whose size depends on the preset data.
Preset item data #
{
"key": "cw",
"xStart": <GridX>,
"yStart": <GridY>,
"coinOpts": {
"perWave": <number>,
"type": <CoinType>
},
"amp": <GridY>,
"wavelength": <GridX>,
"totalLength": <GridX>,
"bombs": true or false,
"bombGap": <GridY>,
}
Values #
xStart #
The GridX coordinate that the wave starts at
yStart #
The GridY coordinate that the wave starts at
coinOpts (optional) #
-
perWave (optional) – how many coins should be spawned per wave
- default value:
10
- default value:
-
type – the CoinType for coins in this wave. See the Coin Spawnable Object page for more information
- options:
default
,green
,red
,blue
- default value:
none
(coin/gem types are chosen based on the game’s default probabilities)
- options:
amp (optional) #
The amplitude of the wave (ie the distance from the midpoint to the maximum height)
default value: 14
wavelength (optional) #
How long a single wave period should be. In other words, the GridX width from a peak in the wave to the subsequent peak in the wave.
default value: 50
totalLength (optional) #
The total length of the entire coin wave. The total number of coins expected in this wave will then be (perWave * totalLength / wavelength)
default value: 300
bombs (optional) #
Determines whether bombs should be spawned above and below the wave.
options: true
, false
bombGap (optional) #
If bombs
is true, this determines how far away (vertically) that the bombs should be spawned from the coin wave. The bombs will always spawn directly above and below a coin in the wave.
Example Level JSONs #
With bombs #
{
"items": [
{
"type": "preset",
"data": {
"key": "cw",
"xStart": 20,
"yStart": 50,
"coinOpts": {"perWave": 30},
"amp": 14,
"wavelength": 50,
"totalLength": 100,
"bombs": true,
"bombGap": 30
}
}
],
"opts": {
"repeat": 5,
"endPadding": 0,
"winCriteria": {"type": "collect-all-coins"}
}
}
High coin density #
{
"items": [
{
"type": "preset",
"data": {
"key": "cw",
"xStart": 20,
"yStart": 50,
"coinOpts": {"perWave": 100},
"amp": 14,
"wavelength": 50,
"totalLength": 100
}
}
],
"opts": {
"repeat": 5,
"endPadding": 0,
"winCriteria": {"type": "collect-all-coins"}
}
}
Coin types #
{
"items": [
{
"type": "preset",
"data": {
"key": "cw",
"xStart": 20,
"yStart": 30,
"coinOpts": {
"perWave": 20,
"type": "default"
},
"amp": 14,
"wavelength": 50,
"totalLength": 100
}
},
{
"type": "preset",
"data": {
"key": "cw",
"xStart": 20,
"yStart": 45,
"coinOpts": {
"perWave": 20,
"type": "green"
},
"amp": 14,
"wavelength": 50,
"totalLength": 100
}
},
{
"type": "preset",
"data": {
"key": "cw",
"xStart": 20,
"yStart": 60,
"coinOpts": {
"perWave": 20,
"type": "red"
},
"amp": 14,
"wavelength": 50,
"totalLength": 100
}
},
{
"type": "preset",
"data": {
"key": "cw",
"xStart": 20,
"yStart": 75,
"coinOpts": {
"perWave": 20,
"type": "blue"
},
"amp": 14,
"wavelength": 50,
"totalLength": 100
}
}
],
"opts": {
"winCriteria": {"type": "collect-all-coins"}
}
}
Tiny waves #
{
"items": [
{
"type": "preset",
"data": {
"key": "cw",
"xStart": 20,
"yStart": 50,
"coinOpts": {"perWave": 8},
"amp": 5,
"wavelength": 20,
"totalLength": 100
}
}
],
"opts": {
"repeat": 5,
"endPadding": 0,
"winCriteria": {"type": "collect-all-coins"}
}
}
Long waves #
{
"items": [
{
"type": "preset",
"data": {
"key": "cw",
"xStart": 20,
"yStart": 50,
"coinOpts": {"perWave": 50},
"amp": 40,
"wavelength": 100,
"totalLength": 300
}
}
],
"opts": {
"endPadding": 0,
"speed": 0.75,
"winCriteria": {"type": "collect-all-coins"}
}
}