Apocalypse mirror
Sourceforge mirror |
News | Info | Characters | Arenas | Screenshots | Forums | Download | ||||
Developer: | Making of | Character-HOWTO | AI Design | Submit a Character | |||
Documentation: | Main Page | Modules | Class Hierarchy | Class List | File List |
#include <Game.h>
Public Member Functions | |
CGame (bool a_bIsReplay, bool m_bWide, bool a_bDebug) | |
~CGame () | |
int | Run () |
Runs a whole game, with two or three rounds. | |
std::string & | GetReplay () |
Returns the replay string of the last round. | |
void | DoReplay (const char *a_pcReplayFile) |
Static Public Member Functions | |
static int | GetBackgroundNumber () |
Protected Types | |
enum | TGamePhaseEnum { Ph_START, Ph_NORMAL, Ph_TIMEUP, Ph_KO, Ph_REWIND, Ph_SLOWFORWARD, Ph_REPLAY } |
Protected Member Functions | |
void | Draw () |
Draws the entire game screen:. | |
void | DrawHitPointDisplay (int a_iPlayer) |
void | DrawHitPointDisplays () |
Draws the hitpoint bars that are displayed on the top of the screen. | |
void | DrawBackground () |
Draws the background, using the m_poBackground object. | |
void | DrawDoodads () |
Draws every doodad that is currently defined in the backend. | |
void | DrawPoly (const char *a_pcName, int a_iColor) |
In debug mode, this method is used to draw the frame of the fighters. | |
void | AddBodyToBackground (int a_iPlayer) |
void | DoOneRound () |
This methods executes one round of gameplay. | |
void | Advance (int a_iNumFrames) |
This method reads and updates the game's variables. | |
int | ProcessEvents () |
ProcessEvents reads events from the SDL event system. | |
void | HandleKey (int a_iPlayer, int a_iKey, bool a_bDown) |
A helper method of ProcessEvents; it manages keypresses and releases of players. | |
void | HandleKO () |
void | HurryUp () |
void | TimeUp () |
void | InstantReplay (int a_iKoAt) |
This methods starts and runs the "instant replay" mode that is done at the end of a game round. | |
bool | IsTeamMode () |
bool | IsNetworkGame () |
bool | IsMaster () |
Returns true if we control our own data, or false if the network supplies us with game data. | |
void | ReadKeysFromNetwork () |
Protected Attributes | |
bool | m_bIsReplay |
bool | m_bWide |
800 or 640 pixel width. | |
int | m_iYOffset |
For wide mode. | |
bool | m_bDebug |
CBackground * | m_poBackground |
SDL_Surface * | m_poDoodads |
int | m_aiHitPointDisplayX [MAXPLAYERS] |
int | m_aiHitPointDisplayY [MAXPLAYERS] |
bool | m_abHitPointDisplayLeft [MAXPLAYERS] |
int | m_aiRoundsWonByPlayer [MAXPLAYERS] |
int | m_iNumberOfRounds |
int | m_iFrame |
int | m_iGameTime |
CKeyQueue | m_oKeyQueue |
int | m_iEnqueueDelay |
std::string | m_sReplayString |
std::vector< int > | m_aReplayOffsets |
enum CGame::TGamePhaseEnum | m_enGamePhase |
SState::TGameMode | m_enInitialGameMode |
Static Protected Attributes | |
static int | mg_iBackgroundNumber = 1 |
This involves reading the game state data from a source (be it a replay file or the backend), handling the keystrokes and network, etc.
|
|
|
|
|
|
|
|
|
This method reads and updates the game's variables. In replay mode, this is done by parsing the replay string. Otherwise the perl backend is advanced the given number of steps. Whichever the case, the variables will be available in g_oBackend. Only the backend-driven variables are modified, the GamePhase and GameTime remain unchanged; these are up for DoOneRound and friends to modify. |
|
This methods executes one round of gameplay. The game progresses through phases Ph_START, Ph_NORMAL, and Ph_KO. If a KO happened, it will invoke InstantReplay. At the end of the round m_aiRoundsWonByPlayer[x] will be incremented depending on the outcome. m_iNumberOfRounds will also increase by 1. |
|
|
|
Draws the entire game screen:.
|
|
Draws the background, using the m_poBackground object.
|
|
Draws every doodad that is currently defined in the backend.
|
|
|
|
Draws the hitpoint bars that are displayed on the top of the screen. Also draws the fighter names below the bars. Input variables:
|
|
In debug mode, this method is used to draw the frame of the fighters.
|
|
|
|
Returns the replay string of the last round.
|
|
A helper method of ProcessEvents; it manages keypresses and releases of players. It is only called when keypresses are actually relevant for the backend (not during instant replay, etc). |
|
|
|
|
|
This methods starts and runs the "instant replay" mode that is done at the end of a game round. This means doing phases Ph_REWIND and Ph_SLOWFORWARD. Rewind will go back in time 200 ticks before the parameter a_iKoAt. |
|
Returns true if we control our own data, or false if the network supplies us with game data.
|
|
|
|
|
|
ProcessEvents reads events from the SDL event system. Relevant key events are fed to the backend. Esc brings up the menu. Returns 1 on quit event (e.g. if the current game or replay should be aborted), 0 otherwise. |
|
|
|
Runs a whole game, with two or three rounds.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
800 or 640 pixel width.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For wide mode.
|
|
|
|
|
|
|
|
|
|
|