BomberMaze advanced documentation


Contents

  1. Introduction
  2. Controls
  3. Rules
  4. Gameplay
  5. Power-ups
  6. Custom Mazes

Advanced Topics

  1. Custom Graphics
  2. Animation Parameters

Custom Graphics

All the graphics in the game can be customized by replacing the graphic files in INSTALL_PREFIX/share/pixmaps/bombermaze/(2) with your own. Each image in that directory specifies the appearance of an object in the game. The PNG file format is used for all graphics because it supports 24-bit color and alpha channels. Alpha channels are used to encode transparency information.

For objects that have more than one frame of animation, the corresponding images themselves contain more than one "frame". Although the appearance of each frame is entirely arbitrary, the actual number of frames is fixed. Each image must be h pixels in height and w * n pixels in width, where w is the width of a single frame and n is the number of frames for that image. The height h must be no more than twice the height of floor.png, and the frame width w must be the same as or smaller than the width of floor.png.

The table below lists the frames for each image.

Image

Frame

Description

floor.png

1

The image floor.png is used as the bottom tile for every single map square. As such, the dimensions of every other tile and sprite is constrained by the dimensions of the floor tile. In particular, no image can have a frame width greater than the floor tile's width, and no image can be taller than twice the floor tile's height. If an image is between 1 and 2 times the height of the floor tile, then it will be rendered in-game with the top portion overlapping the map square immediately above it. The player sprites use this scheme. Most images, however, look better when their height and frame width are exactly equal to those of the floor tile.

The default floor tile is 48 pixels wide and 40 pixels high.

player*.png

1 Player facing up
2 Player facing right
3 Player facing south
4 Player facing left
5 Player being hit by an explosion

wall.png

1 Wall

brick.png

1 Brick
2 Brick shattering when hit by an explosion

bomb.png

1 Bomb

powerup.png

1 Extra bomb
2 Extra blast radius
3 Trigger bomb
4 Kick bomb
5 Extra speed
6 reserved; ignore for now
7 Power-up being hit by an explosion

fire.png

all 16

To describe all 16 fire tiles would be tedious and repetitive. There is actually a pattern to follow, so I'll describe that instead. If, however, you can't count in binary, I would recommend that you take a look at the image itself and just follow the pattern you see there.

Think of each fire frame as a visual representation of a 4-bit integer, starting with 0 and going up to 15 (or in binary, 0000 to 1111). The top edge of each frame codes for the least significant bit, the right edge for the 2's bit, the bottom edge for the 4's bit and the left edge for the 8's bit. If a bit is 0, there is no fire on that edge, and if a bit is 1, then there is a fire on that edge.

For example, frame number 0 (0000) is blank. Frame number 14 (1110), on the other hand, is a T-shaped intersection of fire.

2: If you installed the RPM package for this game, then INSTALL_PREFIX=/usr by default, unless you used the rpm --relocate option. If you installed from source, then INSTALL_PREFIX is whatever you passed to the configure script in the --prefix option. If you did not supply the --prefix option, then INSTALL_PREFIX should be /usr/local. See the file INSTALL for details.


Animation Parameters

Timeout Interval

Animation in the game is handled by a timeout handler function that is called once per timeout interval. In theory, sprite animation becomes faster and smoother as the timeout interval decreases. In practice, this is true only to a point, because the timeout handler function takes a certain amount of time to execute, and when its execution time becomes large relative to the timeout interval, performance suffers. Naturally, a faster CPU can handle a smaller timeout interval.

Note that, owing to the CPU performance issues described above, the time delay that you set for bomb explosions (see Bomb entry in the Rules section) will actually be slightly more than the nominal value. The deviation from nominal becomes greater as the timeout interval becomes smaller.

By default, the timeout interval is 10 milliseconds. Its value can be any integer from 1 to 100.

Steps per Square

A player standing in the middle of a square must move a certain number of steps in order to be considered to have entered an adjacent square. The number of steps that a player can move from the middle and still remain in the original square is called the steps per square.

By default, there are 2 steps per square. It may be set to any integer from 0 to N, such that (2N + 1) is less than or equal to L, where L is the width in pixels of the tile floor.png, or its height, whichever is smaller (see Custom Graphics). For the default tileset, N is 20. Note that the GUI will allow you to enter any value up to 60, but when you apply it, the actual value used by the game will be limited to the range of 0 to N.

Player Movement Delay

From the instant that a command is given for a player to move, there is a slight pause before the player's sprite actually starts moving. The duration of this pause is equal to the player movement delay multiplied by the timeout interval (see above). Whenever a player picks up an Extra Speed powerup, the movement delay for that player is decreased by 1, to a minimum of 1.

All players start off a game with the same initial player movement delay, which is 3 by default. The minimum value allowed is 1.