Generic block game

Variations

Variations are text files that contain game rules. They are stored in variations\ folder. Variations with .var extension are shown in loader's menu. Variations with other extensions can be loaded from within other variations.

Creating new variations

The easiest way to make a new variation is to modify one of the existing ones. So, the first step is to open variations/ folder, make a copy of an existing variation, rename it and open in text editor.

Segments

Variation text file consists of several segments. Segments begin with name of the segment, followed by opened square ( { ) bracket. Segment content begins in the next line. Segment ends with a line that contains only closed square bracket ( } ).

This is an example segment:

Title {
Tetromino factory
}

The interpretation of segments is quite rigid, so don't change upper/lower case or add any extra spaces in titles or within segments. You can however type any text in areas outside of segments.

List of currently supported segments

Title

Title {
Tetromino factory
}

Contains the title. One line only.

Settings

Settings {
tiles:7
gravity
}

Contains one or more lines. Each line is a keyword, which turns on a special feature of the game.

In variation file, Settings should appear before Tilesets

keyword effect
gravity Blocks will fall down. If absent, blocks can be moved in any direction, and must be placed with enter.
wrap Small blocks can be wrapped around the edges of playfield.
inputrotate Signifies that input blocks are meant to be rotated. Cycle is ignored in this case.
tiles:n This setting is mandatory. It indicates how many tiles will be loaded. When used with randominputs it indicates tiles to be used in shapes controlled by player, tiles with higher number can be used for walls, decorations, etc.
randominputs Indicates that numbers in input shapes will be interpreted as random colors. See Input segment.
randomgoals Indicates that numbers in goal shapes will be interpreted as random colors. See Goals segment.

Playfield

Playfield {
!!!!!!!!
........
........
........
........
........
........
........
........
........
}

Playfield is consists of characters, mainly dots, placed in a rectangular formation. Playfield must be rectangular.

valid characters meaning
. (dot) or 0 (zero) empty space, where blocks can pass
numbers or letters various tiles, serving as obstacles. See Tilesets segment.
! source
@ destination

Source

A playfield must have a source. Input shapes appear in source. A source must be large enough for input shapes to appear in it. If an input shape, selected at random, cannot fit inside a source, it is cycled (see Cycle). If neither of cycled shapes can fit, the game is over.

Destination

Destination is not mandatory. If playfield has destination tiles, and all destination tiles are covered with player-controlled shapes, the next variation is loaded (see Next).

Input

Input {
1

2

3

4

5

6

7
}
(In this example, input shapes are all single blocks of different colors.)

Inputs segment contains definitions of several input shapes. The definitions are separated with empty line. The definitions must be of rectangular shape, empty space filled with dots (as in Playfield and Goals)

Valid characters are dots, numbers and letters. Dots represent empty space. With numbers and letters, two modes are possible (see Settings).

Mode Meaning of numbers and letters
Normal mode Numbers and letters represent respective tiles (see Tilesets).
randominputs Numbers and letters represent random tiles, but the same numbers and letters represent same tiles. For example, 1122 would mean two tiles of one random color, and two tiles of another random color.

Cycle

Cycle {
1234567
}
(in this example no cycling appears)

Cycle segment defines which shape is current shape replaced with when player presses the "rotate" button.

Cycle segment consists of a single line, which can contain numbers and letters, excluding 0 (zero). Number on the first position denotes cycle shape for the first shape. Number on second position denotes cycle shape for the second shape, etc. If the cycle would be 23415786, if player controls one of the first four shapes, he could exchange them with one another by pressing "rotate". Same goes for last 3 shapes. Shape 5 would not get rotated.

This segment is ignored if inputrotate is set (see Settings).

Goals

Goals {
111
.1.

1.
11
1.

.1.
111

.1
11
.1

22
.2
.2

222
2..

2.
2.
22

..2
222

33
3.
3.

3..
333

.3
.3
33

333
..3

4.
44
.4

.44
44.

.5
55
5.

55.
.55

6666

6
6
6
6

77
77
}
(In this example, goals are tetrominos, each in its own color. This variation's goal is to form tetrominos which then disappear.)

When goals are formed, they disappear. If gravity setting is on (see Settings) other blocks fall in their place.

Goal segment contains definitions of one or several goal shapes, divided by empty line. Definitions are rectangular fields (as in Playfield and Input), containing valid characters: dots, numbers, letters, exclamation mark (!) and asterisk (*). Asterisk denotes any non-empty block. Exclamation mark matches also empty blocks, if area to disappear is larger than actual matched blocks.

Mode Meaning of numbers and letters
Normal mode Numbers and letters represent respective tiles (see Tilesets).
randomgoals Numbers and letters represent random tiles, but the same numbers and letters represent same tiles. For example, 1122 would mean two tiles of one random color, and two tiles of another random color.

Help

Help {
factory.html
}

Sets file name of the current variation's help file. Default path is variations/

Next

Next {
}

Sets file name of variation which will be loaded when player covers all output tiles (see Playfield). Default path is variations/ . File name can have any extension. Files with extension other than .var will not be shown in loader module.

Tilesets

Tilesets {
tiles.bmp
tilesbig.bmp
tetiles2.bmp
tetiles2big.bmp
}

This segment contains several names of tile images. Tile images contain tiles which will be rendered on the screen.

In variation file, Tilesets should appear after Settings

Structure of a tile image

Tile image is a BMP image. Tiles are squares, arranged in tile image from top to bottom.

Tile Meaning Represented with
background 0 (zero) or . (dot)
source !
destination @
tile 1 1
tile 2 2
tile 3 3
tile 4 4
tile 5 5
tile 6 6
tile 7 7