GameApp

I generally like to put most of the application logic into one class to keep track of globals, as well as targets to certain events.

Constructors

this
this()

Initializes our application. Put other things here if you need them.

Members

Enums

ControlFlags
enum ControlFlags

Defines various states for the control. Mainly used to avoid effects from typematic and such. These are the bare minimum requirements for a game.

StateFlags
enum StateFlags

Defines various states of the game. I have added some quite useful and very often used ones

Functions

axisEvent
void axisEvent(uint id, BindingCode code, uint timestamp, float value)

Called if an axis input event has occured. Note: This function will be changed once I move input handling and output screen handling to iota.

controllerAdded
void controllerAdded(uint id)

Called when a controller is added to the system. Note: This function will be changed once I move input handling and output screen handling to iota.

controllerRemoved
void controllerRemoved(uint id)

Called when a controller is removed the system. Note: This function will be changed once I move input handling and output screen handling to iota.

keyEvent
void keyEvent(uint id, BindingCode code, uint timestamp, bool isPressed)

Called if a key input event has occured. Note: This function will be changed once I move input handling and output screen handling to iota.

loadMap
void loadMap(string m)

This function will load a map file to display levels, or portions of levels. If you're clever, you can store other things in map files

onCollision
void onCollision(ObjectCollisionEvent event)

Collision events can be handled from here.

onQuit
void onQuit()

Called if the window is closed, etd.

whereTheMagicHappens
void whereTheMagicHappens()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

adh
AudioDeviceHandler adh;

Handles audio devices and outputs.

cfg
ConfigurationProfile cfg;
Undocumented in source.
controlFlags
BitFlags!ControlFlags controlFlags;

Contains various control state flags

gameField
SpriteLayer gameField;

Contains pointer to the game field, so we can easily interact with it.

ih
InputHandler ih;

For input handling.

mapSource
MapFormat mapSource;

Stores the currently loaded map file with all related data.

midiSeq
SequencerM1 midiSeq;

MIDI sequencer for MIDI playback.

modCfg
ModuleConfig modCfg;

Loads and handles module configuration, including routing, patches, and samples.

modMan
ModuleManager modMan;

Handles the modules and their output.

ocd
ObjectCollisionDetector ocd;

Detects object collisions that were registered to it.

output
OutputScreen output;

To display our game's graphics

rng
RandomNumberGenerator rng;

Contains the random number generator and its state.

rstr
Raster rstr;

To manage our layers and palette.

stateFlags
BitFlags!StateFlags stateFlags;

Contains various game state flags (is it running, is it paused, etc).

textLayer
TileLayer textLayer;

Contains the pointer to the textlayer. Can be used for the menu, status bars, etc.

Meta