=====Map File Format=====

File Overview:
<background music> - the name of the file to play for background music (in the /music/ folder).  use none for no music
<background R,G,B> - the background color in R,G,B (valid values for R,G,B are between 0 and 1 - ie 0.5 for R is half red)
<tile art file> - the name of the file in the /art/ directory that has the art for your tiles ie "level1.png"
<megaman x> <megaman y> - The X,Y coordinates of where you want megaman to spawn at.  world coordinates, not tile coordinates.
<Moving Platform Deffinitions> - This is where you define moving platforms.
<Sound Definitions> - This is where you define sounds that the map uses
<Paralax Definitions> - This is where you define paralax layers
<Tile Definitions> - This is where you define properties of tiles, such as if you can walk through them, if you can climb them, if they hurt you etc
<Spawn Definitions> - this is where you define what enemies are spawned on the map
<Rectangles> - This is where you define your map as a series of conjoined rectangles

=====Moving Platform Deffinitions=====
<number of platform deffinitions>
<platform id> <location> <dimensions> <movement> <behind> <color> <texture filename> <texture rect>
<platform id> <location> <dimensions> <movement> <behind> <color> <texture filename> <texture rect>
...

<platform id> - the ID# you want to give this platform
<location> - the X,Y coordinate in WORLD SPACE where you want this platform to start at
<dimensions> - a rectangle describing the size/shape of the moving platform in the format X1 Y1 X2 Y2
<movement> - initial movement vector for the platform.
<behind> - if you want the platform to be behind the map layer, put a 1 here, else it will be in front of the map layer
<color> - RGBA color components of the platform.  1 1 1 1 is normal.
<texture filename> - if you want to use a texture on this platform, put the filename here, else put "none" without quotes.
<texture rect> - a rectangle specifying what part of the texture file to use on the platform. 0 0 1 1 is normal. if there is no texture filename, omit this field.


=====Sound Definitions=====
<number of sound deffinitions>
<sound id> <filename>
<sound id> <filename>
...

<sound id> - the ID# you want to give this sound
<filename> - the filename of the sound to load

list as many sounds as you want, ID's must be unique though.  The ID#'s are what you reference when you want to play a sound using a script.

=====Paralax Definitions=====
<paralax layer id> <depth> <rectangle> <art file> <art rectangle> <color tint> <movement factor> <texture autoscroll> <rectangle autoscroll> <text> <mouseover script> <mouseoff script> <click script>
<paralax layer id> <depth> <rectangle> <art file> <art rectangle> <color tint> <movement factor> <texture autoscroll> <rectangle autoscroll> <text> <mouseover script> <mouseoff script> <click script>
...
0

<paralax layer id> - the ID# you want to give this layer, you can use this ID# to manipulate the paralax layer from scripts.  Note that it does not have to be a unique id.  if you change layer ID "2" in a script and 3 layers have ID "2" then all 3 will be changed.  do not use id 0 as that means end of deffinitions!
<depth> - a number saying how "deep" the layer is. the screen where the player and enemies are is depth 0 so anything greater than 0 is in front, anything below 0 is behind (but still drawin in order...ie -3 is closer than -4).
<rectangle> - the rectangle that describes the layer in TILE COORDINATES. ie 10 10 20 20 would be a rectangle from (10,10) to (30,30).
<art file> - the name of the picture to use for the paralax layer or "none" (without quotes) for no art.
<art rectangle> - give the TEXTURE coordinates to map to the rectangle if art file is not "none", else leave this out. 0 0 1 1 would be showing the whole picture on the rectangle. 0.25 0.25 0.75 0.75 would only show the middle 1/2 of the picture on the rectangle (and would stretch it to fit the whole rectangle). 0 0 4 4 would tile the image 16 times on the rectanlge (in a 4x4 grid).
<color tint> - Red,Green,Blue,Alpha tint of the paralax layer.
<movement factor> - how fast the paralax layer moves when the player moves (in X,Y).  0 0 means its stationary on the screen, 1 1 means it's stationary on the map, otherwise the layer will just scroll as the player walks. movement factor is multiplied by the cameras distance from 0,0.
<texture autoscroll> - if you want the texture to auto-scroll over time, put 2 numbers here: a factor for X and a factor for Y.
<rectangle autoscroll> - if you want the layer to move over time, put 2 numbers here: a factor for X and a factor for Y
<text> - if you want text to be displayed put it here, but put it in quotes.  if you dont want text, put "".
<mouseover script> - a script to run when the mouse goes over the paralax layer.  The script used is tile script.  put a 0 if you don't want a script.
<mouseoff script> - a script to run when the mouse goes off the paralax layer.  The script used is tile script.  put a 0 if you don't want a script.
<click script> - a script to run when the user clicks the paralax layer.  The script used is tile script.  put a 0 if you don't want a script.

list as many deffinitions as you want and then put a 0 at the end


=====Tile Definitions=====
<number of tile deffinitions>
<tile number> <flags and data>
<tile number> <flags and data>
...

<number of tile deffinitions> - This is how many tiles you are defining, any tile that isnt defined is just assumed to be a regular tile you can't walk through (except tile 0 which is assumed to be walk through by default)

<tile number> - the number of the tile you want to define, you dont have to define them in order or anything

<flags and data> - Heres a list of flags and any parameters they want:

<art> - what art tile you wish to use for this tile
<solid> - 0 = you can walk through it, 1 = you cant
<ladder> - 0 = not a ladder, 1 = you can climb it
<solid to bullets> - 0 = you can shoot through it, 1 = you cant
<jump up> - 0 = normal, 1 = you can jump through it from the bottom
<jump down> - 0 = normal, 1 = you can jump down through it from the top when you press down and jump
<touch damage> - amount of damage done when player touches it, 0 = none, 4 = ouch, 100 = instant death etc
<timer> <tile #> - if timer isnt 0, then it also requires <tile #>, if timer is 0, leave <tile #> off.  If timer is 1500, then after 1500 miliseconds, any tile that is of this type will become <tile #> this is useful for animation or for tiles that apear/disapear etc.  if you give a tile # of -1, then after the tile deffinition it will expect a block of script codes.  see below for info on script code blocks.
<life> <tile #> - if life isnt 0, then it also requires <tile #>, if life is 0, leave <tile #> off.  If life is > 0, when damage is done to this block and it's life reaches 0, it becomes <tile #>.  A tile must be solid to bullets for this setting to work.  if you give a tile # of -1, then after the tile deffinition it will expect a block of script codes.  see below for info on script code blocks.
<checkpoint> - if this is 1, when a player touches this tile, when they die they will be respawned here
<level exit> <next level> - if this is 1, when they player touches this tile, it assumes the player beat the level and takes them to <next level>. use "none" to return them to the level select screen. if this flag is 0, leave <next level> off
<trigger> <tile #> if trigger is 1, then it also requires <tile #>.  if trigger is 0, leave <tile #> off.  What happens is when the player enters this tile, it will change to tile #.  if you give a tile # of -1, then after the tile deffinition it will expect a block of script codes.  see below for info on script code blocks.
<tint> - the R,B,G,A of the tile.  1 1 1 1 for normal.
<flip> - to flip it on X or Y axis, you can use these 2 flags.  0 0 for normal.
<rotation> - to rotate, put a number here (in degrees).  0 for normal
<translation> - X and Y translation to move tile art up or down, left or right. 0 0 for normal.
<scale> - to stretch or shrink tile art. 1 1 for normal.


=====Script Code Blocks=====
Please refer to scriptformat.txt for information about script code blocks

=====Spawn Definitions=====
<number of spawn deffinitions>
<tile x> <tile y> <enemy type> <face direction>
<tile x> <tile y> <enemy type> <face direction>
...

<number of spawn deffinitions> - This is how many monsters you want spawned in the level.
<tile x> <tile y> - the X and y coordinate of where you want the monster spawned in.  World coordinates, not tile coordinates.
<enemy type> - what type of enemy to spawn
<face direction> - the way you want the enemy to face -1 = left, 1 = right


=====Rectangles=====
In this section you list the rectangles of your map and the tiles that make up the rectangles

It is made up of 1 or more rectangle deffinitions that look like this:

<Rectangle X> <Rectangle Y> <NumTiles X> <NumTiles Y>
<Friction> <Air Friction> <Gravity X> <Gravity Y>
<OverLayer>
<tile data>
<OverLayer data>

<Rectangle X>, <Rectangle Y> - the coordinates in tiles where the rectangle starts (whole numbers only)
<NumTiles X>, <NumTiles Y> - how many tiles big the rectangle is on X and Y axis (whole numbers only).
<Friction> - How much the ground slows you down
<Air Friction> - How much the air slows you down
<Gravity X> - How much gravity is there on the X axis.
<Gravity Y> - How much gravity is there on the Y axis. 1 = normal, 0.5 = half, 2 = double, -1 = anti gravity etc
<OverLayer> - if you want an overlayer, put a 1 here, else a 0
<Tile Data> - (NumTiles X * NumTiles Y) worth of whole numbers that say the # of the tile to use
<OverLayer data> - if you have an overlayer put the data here, else dont put anything.  Note that you can use any tile flags you want for overlayers but it will ignore most flags (such as causing damage, being solid etc)