Thrust -- Level description

Thrust -- Level description

This text describes how to construct a new level and what changes needs to be made in the source code to include it in thrust. I hope it is sufficient and clear, please mail and ask if it is not. All referenses to files are relative to where you have installed the source of thrust.

Changes to the source code

How to build the file 'level*.def'

A level is made up of blocks (8 by 8 pixels) and these blocks are drawn in a textfile. Since some sections of a level are the same for all levels these sections aren't drawn by hand for each level. Instead these sections are characterized by their size.

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

  1. <width>
  2. <total height>
  3. <height of 'Stars'>
  4. <height of 'Space'>
  5. <height of 'Bedrock'>
  6. <red>
  7. <green>
  8. <blue>
There can be only one number per line. The order is important and there can be a comment after the number itself but not before.

The difference between the above sum (point 3) and the total height (point 2) defines how many rows the definition of the cave is. Each row of the cave-definition should be at least <width> characters long. Only the first <width> characters are used; any characters to the left of these will be discarded.

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.


And don't forget to send me a copy if you have created a nice level.


The things in the cave

The objects in the cave can be separated into two groups. Things you can shoot at and other things.

Things you can shoot at in the cave

(maximum 32, tell me if you need more)

Fuel

 `a
 bc


The fuel is a four block structure.

Power plant

 def
 ghi
 jkl


The power plant is a 9 block structure. There should be exactly one of these in a level.

Buttons

 xL
  M


The 'x' can be exchanged for any character. All buttons with the same 'x' are connected and have the same effect when hit by a bullet. The 'x' will be replaced with a 'p' (solid ground).

 xN
  O


The 'x' can be exchanged for any character. All buttons with the same 'x' are connected and have the same effect when hit by a bullet. The 'x' will be replaced with a space.

Guns

 PQR
   S


 UVW
 T


   [
 XYZ


 \
 ]^_


Other things in the cave

The green blob

 m


There should be exactly one of these in each level.

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


 {


 }


 |


 ~