Gravity Defied for Android

How to create your own levels

GD levels are JSON files

JSON in general is described here http://sv.wikipedia.org/wiki/JSON
This is an example of a level file.
{
"name": "Going Up",
"author": "Codebrew Software",
"scheme": "beach",
"1-star": "00:02:00",
"2-star": "00:01:55",
"3-star": "00:01:50",
"start": [-423, 33 ],
"goal": [165, 0 ],
"points": [
-562, 21,-548, -26,-536, -36,-522, -27,-516, 1,-492, 50,-483, 59,-470, 62,-440, 62,
-409, 62,-396, 61,-369, 65,-314, 72,-252, 65,-194, 64,-154, 56,-120, 47,-91, 38,-64, 26,
-38, 10,-8, -12,35, -50,59, -59,156, -56,249, -72,346, -54,465, -63,496, -106,509, -120,
519, -83,528, 6]
}
This is the same file but with comments.
{
"name": "Going Up", # Name of the level that will be displayed.
"author": "Codebrew Software", # The name of the author
"scheme": "beach", # This is the name of color scheme.
                   # Can be one of "Dustbowl", "Beach", "Green", "french", "Crisp", "Sunny"
"1-star": "00:02:00", # The time that will award a one star score.
"2-star": "00:01:55", # The time that will award a two star score.
"3-star": "00:01:50", # The time that will award a three star score.
"start": [-423, 33 ], # The starting position of the driver, X=-423, Y=33
"goal": [165, 0 ], # The position of the goal flag, X=165, Y= ignored
"points": [
-562, 21, # Coordinates of the first point on the map, X=-562, Y=21
-548, -26, # Coordinates of the second point on the map, X=-548, Y=-26
-536, -36, # etc...
-522, -27, -516, 1,-492, 50,-483, 59,-470, 62,-440, 62,
-409, 62,-396, 61,-369, 65,-314, 72,-252, 65,-194, 64,-154, 56,-120, 47,-91, 38,-64, 26,
-38, 10,-8, -12,35, -50,59, -59,156, -56,249, -72,346, -54,465, -63,496, -106,509, -120,
519, -83,
528, 6 # Coordinate of the last point of the map, X=528, Y=6
]
}

How to install

For each level pack you want to create,
create a directory under /sdcard/gd/, for example /sdcard/gd/mylevels/
Levels will be sorted on file name so you can order the levels by using file names starting with numbers. Name your files 001_YOUR_FIRST_LEVEL.gdlvl, 002_YOUR_SECOND_LEVEL.gdlvl and so on. Place your JSON level files under /sdcard/gd/mylevels/. If you want to give your level pack a name you can create a file called pack.def in your level pack directory containing a simple JSON string,
{ "packName": "My Levels" }

Guide for creating levels

This guide describes how to create levels using pen and paper. Maybe there will be a real level editor available some time, maybe not.
  • Get graph paper
  • Draw axii where each square is 10 units high/wide.
  • The first coordinate value (X) increases from left to right
  • The second coordinate value (Y) increases from up to down
  • You can place origo wherever you like
  • Draw the bike so you get an idea of the scale, the wheel centers are 30 units a part so the bike should be a bit larger than three squares on your graph paper.
  • Draw your map on the graph paper
  • Note that the sequence of points MUST HAVE increasing X coordinates.
  • Transfer the coordinates from the graph paper to a JSON file
  • Check that the JSON syntax is ok here: http://jsonlint.com/
  • Install the JSON file on your device

How to create polished maps

  • Check that your map is closed so that it is impossible to fall off
  • Check that there are no extremely sharp points since they are hard to get good traction on
  • Use enough points to get a fairly smooth curve
  • Put the hardest jumps first

Future

Send your feedback to feedback@codebrew.se.

Copyright © 2008, webmaster[at]codebrew.se