The level definition begins with 8 numbers. These numbers describes how large the level and it's different sections will be. They also defines the color of the bedrock. There are four sections in a level. The uppermost section is filled with stars and the section just below this section is empty space (black). The section at the bottom will be filled with blocks forming the bottom of the bedrock. This leaves us with one section where the cave can be drawn.
------------------
| |
| Stars |
| |
| |
|------------------|
| Empty space |
|------------------|
| |
| Cave |
| |
| |
|------------------|
| Bedrock |
| |
------------------
The eight numbers mentioned above are
The definition of the actual cave is drawn after these 8 numbers. Each line in the file will translate inte one row of blocks and should therefore be at least <width> characters long. Empty spaces at the end of the line are NOT implicit and must be included to get a well defined behaviour.
You can draw an invisible barrier in a cave by inserting the character '#'. This is done in order the make stages withing the level. It's nice with some stages so that the whole level doesn't have to be completed without a crash. Typically these barriers should be drawn so that it's impossible to pass the barrier without passing at least one of the '#':s. When the ship passes such a barrier, the ship will restart at the closest '*' when/if there is a crash. Take care when positioning the '*' so that it works for a lone ship as well as for a ship connected to the green blob. Also take care so that it works for reversed gravity. The risk is to position the restart point in a way that makes the ship crash immediatly when put in that position. Look at the 2nd restart point in level 4 (/datasrc/level4.def) to see how much space is needed above and below the restart point to make it 'safe'.
A think that all levels should have at least one restart point and one barrier that has to be passed in order to pick ut the blob. If this is true you don't have to pick up the blob more than once.
There is a maximum of 512 barrier-'#' and 16 restart-'*'. Tell me if you need more (or look in '/src/thrust.h').
Below is a short description of the different building blocks for the cave. If you have trouble, you can always look at the included levels or you can send me an email.
An example is also available.
Fuel
`a bc
Power plant
def ghi jkl
Buttons
xL M
xN O
Guns
PQR S
UVW T
[ XYZ
\ ]^_
m
Sliders
(Maximum 16, tell me if you need more)
Sliders are triggered by shooting at the closest button (or one equivalent to it, see the description of the buttons) and there can be any number of p:s in between the to endpoints.
FpppppH
When triggered, the cave opens from F to H.
HpppppG
When triggered, the cave opens from G to H.
I
p When triggered, the cave opens from I to K.
K
K
p When triggered, the cave opens from J to K.
J
Building blocks for the ground in the cave
p
q
r
s
t
u
v
w
x
y
z
{
}
|
~