Skip to content

The config files

alfem edited this page Mar 21, 2013 · 19 revisions

Table of Contents

The config files

An important part of Games Pit behaviour is defined in config files.

These config files are made of plain text with the typical .INI format. You will find comments -starting with #-, sections like [GAME] or [COLORS] and settings like base_path or title.

To modify a file, just use your favourite text editor.

These files are re-read from disk every time a game is launched. You can run your game, change a setting, exit to main menu, an run again the game with the new settings.

Two different config files affect your minigame: the main gamespit.conf and your specific game.conf file. Both files are merged before your game is executed, so you can overwrite a general setting with your own values if needed (be careful!).

Main Config File: gamespit.conf

These are the settings you can change in gamespit.conf

General

games_path (path)
full path to minigames directory
help_speed (integer)
value used to keep help text on screen before a game is launched. Miliseconds per character.
debug (True/False)
when True activates some useful informations about files loaded, fonts defined...
hacker_mode (True/False)
when True activates two special keys in the main menu: 'c' to edit game configuration and 'e' to edit game code.
editor (path)
full path to your favourite editor. Used only if hacker_mode is activated.

[DISPLAY] Section

width (integer)
width of the screen
height (integer)
height of the screen
full_screen (True/False)
Games Pit will start in a window when False of full screen when True
default_font (text)
full path to default TrueType font file. It is used for help text.
default_font_size (integer)
default font size. It is used for help text.
default_color (rgb list or text)
default text color. It is used when no color is specified in your game.
default_background (rgb list or text)
default background color. It is used when no color is specified in your game.
debug (True/False)
when True activates some useful informations about the graphic display

Game Config File: game.conf

[GAME] Section

title (text)
a title for your game. Used in the main menu.
mouse (True/False)
show or hides mouse pointer in your game.
help (multiline text)
instructions, keys or mouse usage and goals of your game. It can (used to) be multiline. To write a multiline help, start it with triple apostrophe ('''), end your lines just with Enter, and finish the paragraph with another triple apostrophe.
font_sizes (list)
list of font sizes you will use in your game.
pointer (multiline text)
mouse pointer definition. It is a long string made of O, 0 and . forming the B&W image of the cursor. O will be replaced by white pixels, 0 by black ones and . for transparent zones. Bear in mind that width and height must be divisible by 8. You will find further information and samples in Pygame Cursor Page

[COLORS] Section

name (rgb list or text)
adds name to the list of available colors in your game. You can define as many names as you want. The value of this setting must be a valid color in rgb (n,n,n) or Pygame