# Getting Started

Before you begin, you will need to download Sphere. Sphere is the game creation system that this game has been made with. Don't worry, the program is free and you'll only have to deal with one aspect of the program: the map editor.

Instructions on how to use Sphere's map editor are available here.

Just open up the Sphere project "startup" in this game's location and have fun mapping!

# Important notes on mapping

There are some things you should know before attempting to make a map for Sir Boingers:

- Put your maps in a subdirectory in `maps`. Example: maps/myname/somefile.rmp
- Your maps only need one layer. Any obstructions or items on other layers are ignored.
- You can make and use your own map tilesets. If you do so, however, you will have to create tile obstructions and define hazardous tiles yourself (give them the name "hazard" in the tile editor).
- Make your levelset (or levels) easily distributable. That means, the contents of your archive should look approximately like this:
  `myname.set.txt
  myname's 2nd set.set.txt
  myname/map1.rmp
  myname/wheezy.rmp
  myname/about.txt` (could contain info about you)
- Send us your levelsets! We'll feature them right on our site for people to download and enjoy more content. :)

# Defining a levelset (or "map list")

A levelset is a simple text file that contains a list of map files (and the songs to use for each map file). With them, you can create a custom order to play the maps in, including new ones.

A line in a levelset file looks as follows:
`default/wheezy.rmp music/levelsong1.ogg`

That is, directory/filename, two spaces, music/filename.
The part before the two spaces tells Sphere where the map file is (in this case in maps/default/wheezy.rmp); the part after it tells the game where the music to play is (this can be left empty if you like).

Each line in the levelset looks like the one above. Change the order of lines, and you will change the order of the levels in-game.

When creating a custom levelset, it is advised that you put your custom maps in a separate subdirectory. For example, the above levelset used the `maps/default/` subdirectory, so you could create a new one based on the name of your levelset, or your nickname, etcetera. Just keep the name short and simple. However, always put the levelset file in the root of the maps directory, or Sphere won't detect it.

# Testing your map

If you wish to test a specific map, make sure it's in a levelset. Your levelset can consist of just the map to test it, or you can put a bunch of maps in the set and use the F7 cheat key to auto-win previous levels.

# Giving a person "dumb" AI (PathItem)

Add a person to the map and go into its On Create script. Put something like the following in there:
`new PathItem(person, type, movement);`

The arguments mean the following:

- `person (String)` - The person to add this movement to. Since it's always your current character, make this value `GetCurrentPerson()`.
- `type (String)` - The person type. See topic below.
- `movement (Array)` - Defines the movement pattern for the character. See topic below.

In the end, your line is supposed to look something like this:
`new PathItem(GetCurrentPerson, "enemy", [["north", 100"], ["south", 100]]);`

# Person Types

A person type is something I have added to Sphere persons to indicate what exactly they are, so the engine can act accordingly to their types and not their names.
In Boingers' case, the following types currently exist:

- `enemy` - Hurts player.
- `lethal-enemy` - Kills player instantly.
- `platform` - Platform
- `nojumpkey` - Platform on which you can't jump high.

Person types are strings, don't forget to put them in double quotes (ex. `"lethal-enemy"`).

# Movement patterns

A movement pattern lets you define what path a person should follow.

It is basically a bunch of arrays inside an array with movement instructions. When the end is reached, the game starts back at the beginning of the array. Each subarray contains two values:

- The direction to move in (as a string);
- The amount of pixels to move into that direction.

A subarray in a movement pattern looks like this:
`["north", 100]`

That's basically the command to move north 100 pixels. Now, this needs to be packed together with other movement instructions, that's why this array is inside another one:
`[["north", 100"]]`

If we would add the instruction "move east 32 pixels" to that, the pattern will look like this:
`[["north", 100"], ["east", 32]]`

Don't forget to always end up at the exact place where you begun, or the position may begin to shift and your person may wander off-screen. (So in the last example we need to add south 100 and west 32 too, in any order you like.) Also note that you do not NEED to give a movement pattern to your person. In that case, pass an empty array to it:
`[]`

# Adding helptext at the top of the screen

First, make a zone where you want the text to appear.
Then, add the following line to its script (right click > edit zone):

`LEVEL.helptext = "Your text here";`

When you enter the zone in-game, you'll see the text scroll by at the top of the screen. When you leave it, it disappears.

# Placing cupcakes and other goodies on the map

Just place them on the map, but make sure:

- Their names start with the spriteset name (ex. "hearts_1"; "cupcake_1");
- Their names are unique (so no "cupcake" as a person's name for ALL cupcakes).