Chapter 4. Developer's Guide to Killbots

Interested individuals can customize Killbots in two major ways: themes and rulesets.

Creating Custom Killbots Themes

Like most other KDE games, a Killbots theme consists of three files.

The Desktop File

The desktop file follows standard INI syntax. The key-value pairs store information about the theme and point to the other files included in the theme. The following example is taken from the default theme.

Example 4.1. An Example Theme Desktop File

Name=Example Theme
Description=An example theme used to demonstrate theme creation. This one features pirates.
Author=Mr. Artist

The first four parameters contain metadata about the theme and are straight forward enough. For Killbots themes, the Type parameter should always be set to SVG. The final two parameters contain the file names of the two other theme files. While it's not strictly necessary, it is highly recommended that, for consistency's sake, all three files share the same base file name.

The Preview File

The preview file is simply a PNG file containing a preview of the theme. The preview image should be 240 by 140 pixels and match layout of the default theme's preview as closely as possible, as this makes it easier to compare themes in the theme selector.

The SVG File

The SVG file is a scalable vector graphics image that contains the actual graphical elements used to make up the theme. The file may be either in uncompressed .svg or compressed .svgz format. Each game element is identified by a unique id in the SVG file. When creating a new theme, it is generally easiest to start with an existing theme and replace the elements one by one until the theme is complete. The SVG file must contain the following elements.


The image displayed behind the grid in the main game area.


The box used to display the current round, score, enemy count and energy.


This element should be a rectangle of a single color. Its color is used to for the text in the status boxes.


An individual grid cell.


The character controlled by the player.


The basic enemy.


The faster enemy.


The remains of a collision between enemies.


A cursor indicating movement to the right.


A cursor indicating diagonal movement up and to the right.


A cursor indicating movement up.


A cursor indicating diagonal movement up and to the left.


A cursor indicating movement to the left.


A cursor indicating diagonal movement down and to the left.


A cursor indicating movement down.


A cursor indicating movement down and to the right.


A cursor indicating staying in place.

Installing Custom Themes

In order for Killbots to detect and use a new theme, the files must be moved to an appropriate directory. To install the theme for only the current user, copy the desktop, preview and SVG files to killbots/themes in the local folder in qtpaths --paths GenericDataLocation . To make the theme available system wide, move the files to killbots/themesin the system folder in qtpaths --paths GenericDataLocation . Note that this will likely require administrative privileges.