Coordinate System

Table Of Contents

GridX #

Value from 0 to 900. This represents X% of the game width, starting from the lefthand side. For example, if the game width is 100 pixels, an object with GridX = 60 will spawn 60 pixels away from the left edge of the game, and 40 pixels from the right edge of the game). A GridX of 500 will spawn the object off-screen initially at 500% of the game width, which will eventually appear on the screen as items continue to move left towards the player.

Spawn X #

All objects begin spawning at a specific point off-screen, so the actual x position upon spawning will be GridX + SpawnX. This is to allow the items to travel to the player instead of appearing behind the player upon spawn, such as when the object’s X value is less than the player’s X position.

GridY #

Value from 0 to 100. This represents Y% of the game height, where 0 is at the top of the screen and 100 is at the bottom. For example, if the game height is 100 pixels, an object with GridY = 60 will spawn 60 pixels away from the top edge of the game, and 40 pixels from the bottom edge of the game.

Example #

{
  "type": "chunk",
  "data": {
    "25": [
      {"key": "c", "gridY": 0},
      {"key": "b", "gridY": 50}
    ],
    "50": [
      {"key": "b", "gridY": 25},
      {"key": "c", "gridY": 75}
    ],
    "75": [
      {"key": "c", "gridY": 50},
      {"key": "b", "gridY": 100}
    ]
  }
}

This chunk will spawn objects in this shape:

The first entry (x = 25) spawns a coin at [x = 25, y = 0 (top of game)] and bomb at [x = 25, y = 50 (halfway between the top and bottom of game)]

The second entry (x = 50) spawns a bomb at [x = 50, y = 25] and coin at [x = 50, y = 75].

The third entry (x = 75) spawns a coin at [x = 75, y = 25] and bomb at [x = 75, y = 100]