Skip to content

Reading Stage Data Files

Jason edited this page Aug 21, 2025 · 2 revisions

The page is dedicated to explain how stages are read to let the player select one of them.

General information

All the stage data files are stored in the "Resources" directory in the project. The system reading these files looks for JSON file extension and this process is initiated on start of the stage selection scene.

Data structure

To make a stage properly working, a file should contain the two specific properties:

  1. "tileIndexes",
  2. "enemyTypes".

tileIndexes

The "tileIndexes" property is an array with 26x26 integer values (the size is adjusted for the playing area on the stage scene). These values indicate index meaning what tile must be placed in a specific cell.

The following table presents what index is assigned to what type of a tile (starts from zero):

Index Tile type
0 Bricks
1 Metal
2 Grid
3 Slippery Floor
4 Toxic Waste

If a cell need to be free (none of the above), then it takes a value of -1 (negative one).

enemyTypes

The "enemyTypes" property is also an array but this time is made for defining a "queue" of enemies to spawn. Stored values have to represent a type of a string wherein an integer value must be placed. An integer indicates what type of enemy should be spawned.

The following table shows what index is assigned to each of the enemy types (starts from zero):

Index Enemy type
0 Blue
1 Cyan
2 Magenta
3 Golden

When a string has the "B" prefix, it means that this enemy will have a bonus and it will be "glowing" itself when spawned.

Clone this wiki locally