conf
—game configuration¶
This is a
settings.DummySettingsManager
instance used for configuration. Changes to many of these settings should
occur before the engine is initialised to take effect.
-
IDENT
= 'game'¶ Game identifier, used in some filenames.
-
DEBUG
= False¶ Just a debug flag to establish convention; doesn’t get used by anything in the engine.
Timing¶
-
DROP_FRAMES
= True¶ Whether to allow dropping frames if the game cannot run at full speed. This only affects the draw rate, not the world update rate.
-
MIN_FPS
¶ If
DROP_FRAMES
isTrue
, this gives the minimum frames per second allowed, as a{
World.id
: fps}
defaultdict, with default value25
. (That is, frames are not dropped if the real draw rate would fall below this number.)
-
FPS_AVERAGE_RATIO
= .3¶ This determines how frames are averaged to handle slowdown and determine the framerate. It’s a rolling average, so that each frame, we do:
average = (1 - FPS_AVERAGE_RATIO) * average + FPS_AVERAGE_RATIO * frame_time
Paths¶
-
CONF
¶ File in which settings to be saved are stored. Defaults to
~/.config/<IDENT>/conf
or%APPDATA\<IDENT>\conf
.
-
EVT_DIR
= 'evt/'¶ Directory to load event configuration files from.
-
IMG_DIR
= 'img/'¶ Directory to load images from.
-
SOUND_DIR
= 'sound/'¶ Directory to load sounds from.
-
MUSIC_DIR
= 'music/'¶ Directory to load music from.
-
FONT_DIR
= 'font/'¶ Directory to load fonts from.
Display¶
-
WINDOW_ICON
= None¶ Path to image to use for the window icon.
-
WINDOW_TITLE
= ''¶
-
MOUSE_VISIBLE
¶ Whether the mouse is visible when inside the game window. This is a
{
World.id
: visible}
defaultdict, with default valueFalse
.
-
FLAGS
= 0¶ Extra flags to pass to
pygame.display.set_mode
.
-
FULLSCREEN
= False¶ Whether to start the window in fullscreen mode.
-
RESIZABLE
= False¶ Whether the window can be freel resized (also determines whether fullscreen mode can be toggled).
-
RES_W
= (960, 540)¶ Window resolution.
-
RES_F
= None¶ Fullscreen resolution; if
None
, the first value in the return value ofpygame.display.list_modes
is used.
-
RES
¶ Current game resolution, no matter the display mode. Only exists if the game has been run.
-
MIN_RES_W
= (320, 180)¶ Minimum windowed resolution, if the window can be resized.
-
ASPECT_RATIO
= None¶ Floating-point aspect ratio to fix the window at, if it can be resized.
Input¶
-
GRAB_EVENTS
¶ Whether to grab all input events (in which case operating system and window manager shortcuts like alt-tab will not work). This is a
{
World.id
: grab}
defaultdict, with default valueFalse
.
-
GAME_EVENTS
¶ An event configuration string loaded into each world’s event handler.
Audio¶
-
VOLUME_SCALING
= 2¶ Used in default audio volume scaling (see
World.scale_volume
).
-
MUSIC
¶ Automatically generated
{dir: filenames}
dict for files present inMUSIC_DIR
and subdirectories (only one level deep).dir
is the empty string for the root directory, and is always a name, not necessarily a path.filenames
is a list of paths relative to the working directory at startup, and may be empty.
-
MUSIC_AUTOPLAY
¶ If
False
, music is loaded, but initially paused. This is a{
World.id
: volume}
defaultdict, with default valueFalse
.
-
SOUNDS
¶ Automatically generated
{sound_id: num_sounds}
dict for sounds present inSOUND_DIR
. Finds sound files of the form<sound_id><number>.ogg
for integer numbers starting from0
with no gaps.
-
MAX_SOUNDS
= {}¶ {sound_id: num}
dict giving limits on the number of simultaneously playing instances of sounds, forsound_id
inSOUNDS
.
-
SOUND_ALIASES
= {}¶ An
{alias: sound_id}
mapping forsound_id
inSOUNDS
to allow usingalias
as a sound base ID when playing a sound, with its own value inSOUND_VOLUMES
, etc..
Resources¶
-
DEFAULT_RESOURCE_POOL
= 'global'¶ Default
ResourceManager
resource pool name. Resources cached in this pool are never dropped while the game is still running.
-
TEXT_RENDERERS
¶ text.TextRenderer
definitions to make available inGame.text_renderers
, as a{
World.id
: renderers}
defaultdict with default value{}
.renderers
is{name: renderer}
, whererenderer
is aTextRenderer
,(font, options)
as taken byTextRenderer
, or justfont
.