Level Design
You can create you own layouts to Cube Runner and publish them for anyone to play.
This is very simple and layouts can be created using any text editor.
Sample Layout
@deflayout Sample Layout
Intro 15 1
zigzag 20 1
loop 1
@end deflayout
@level zigzag
x x
x x
x x
x x
x x
x x
x x
x x
x x
x x
@end level
Starts the layout definition called Sample Layout. This contains the list of layouts that will be used
Ends the layout definition
Lists the layouts and various parameters associated with them
This defines a new level called zigzag
The level
Ends the level
Below shows a sample layout file.
It defines a new layout called Sample Layout.
This layout contains 2 levels - Intro and zigzag, and once these have finished then it loops back to the first level.
This layout also contains a level definition called zigzag.
Now you may be wandering where the Intro level is defined - after all, we have got the zigzag level. Well, Intro is a pre-defined level (of which there are a few - more on that a bit later) which you can use within your own layouts, and this is the introduction level that you see on the built in layouts.
More Details on the file format.
Layout Format
Each file must start with a @deflayout <name of layout> line and also have an @end deflayout line.
Between these two lines is a list of all the levels that will be used by this layout.
The last line within the @deflayout section is a loop line. This line says that when you reach the end of the levels, start back at this position - the 1st level is 1.
e.g. loop 3 would loop back to the 3rd level once all levels had been completed.
Each level line should be of the format:
<Layout Name> <Speed> <Day/Night>
Layout Name is the name of the level. This can be one of the standard levels or your own custom level.
Speed is how fast the level will move. 10 is slow, 35 is fast. You can go outside this range but it may make your level unplayable
Day/Night is whether the level is daylight or night and should be 1 for day and 0 for night.
There is an additional level format that you can use which is:
Random <Duration> <Speed> <Difficulty> <Day/Night>
This defines a level that is comprised of random blocks.
Speed and Day/Night are the same as defined above.
Duration is how long the random layout lasts and is in seconds.
Difficulty is a number between 0 and 100 and is the chance of a block being placed at any moment. Suggested values are 20 for easy and 60 for difficult.
Level Format
Each custom level should be contained within a line that looks like @level <level name> and a line containing @end level.
Within this block is the level format. Each line consists of either x or space where an x is a block.
To optimised performance, each line should end with a x without any trailing spaces.
Making Layouts available for download
To make a layout available for download, it must be compressed using gzip compression (there are free gzip compression utilities available for most operating systems). This file can then be uploaded to a Web Server and can be downloaded from with the Cube Runner game.