First, upon generator data usage, all powerups that do not meet the conditions (if specified) should be removed from the list. Then, from the remaining entries, pick one. When no entries are left, use fallback generator if specified. Else, don't spawn anything.
Notes
When weight is omitted, it defaults to 1.
When conditions are omitted, no checks are performed.
Example condition types:
color_present - check if a given color exists on the board.
level_number - check if the current level is a number that equals/is in range of number.
A powerup generator would be a JSON file containing spawnable powerups and corresponding chances and spawn conditions.
Some important changes would be made as a result:
config.json
Example:
vanilla_generator.json
vanilla_generator_colorbomb.json
How would it work:
First, upon generator data usage, all powerups that do not meet the conditions (if specified) should be removed from the list. Then, from the remaining entries, pick one. When no entries are left, use fallback generator if specified. Else, don't spawn anything.
Notes
weight
is omitted, it defaults to1
.conditions
are omitted, no checks are performed.color_present
- check if a givencolor
exists on the board.level_number
- check if the current level is a number that equals/is in range ofnumber
.