Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

game.h File Reference

The control of the game itself. More...


Defines

#define VIEW_WIDTH   (12)
 Visible blocks on X axis in game viewport.

#define VIEW_HEIGHT   (10)
 Visible blocks on Y axis in game viewport.

#define OVERLAPS_VIEW(x1, y1, x2, y2)   (OVERLAPS(x1,y1,x2,y2,16*xo,16*yo,16*(xo+VIEW_WIDTH)+(8*xo_small),16*(yo+VIEW_HEIGHT)))
 Tests if rectangle overlaps portion of world visible on screen (pixel coordinates).

#define IN_VIEW(x, y)   (INBOUNDS(x,y,xo*16,yo*16,16*(xo+VIEW_WIDTH)+(8*xo_small),16*(yo+VIEW_HEIGHT)))
 Tests if point is directly inside portion of world visible on screen (pixel coordinates).


Enumerations

enum  EdjGameSounds {
  SOUND_PICKUP = 0,
  SOUND_SHOOT,
  SOUND_EXIT,
  SOUND_OPENDOOR,
  SOUND_MAX
}
enum  EJump {
  JUMP_NORMAL,
  JUMP_POWERBOOTS
}
 Jump modes.


Functions

void AddThing (CThing *pThing)
 Add a CThing to the current array of things in the level.

void HeroSetJumpMode (EJump eJump)
 Set hero's current jump mode.

void SetLevel (int nLevel)
 Set current level (0-based index).

int GetCurrentLevel ()
 Get current level (0-based index).

void Die ()
 Lose a life.

void GameHeartBeat ()
 The main game "tick" routine.

void GameDrawSkin ()
 Draw the main game skin.

void GameDrawLives ()
 Draw hero's remaining "lives" (OBSOLETE?).

void GameDrawView ()
 Draw the main game view.

void GameDrawFirepower ()
 Draw hero firepower.

void GameInitialSetup ()
 Once off initialization stuff.

void GameFinalCleanup ()
 Final cleanup.

void GameSetup ()
 Per-game initialization.

int GameLoadSprites ()
void GameLevelSetup ()
 Per-level initialization.

void GameCleanup ()
 Per-game cleanup.

void GameLevelCleanup ()
 Per-level cleanup.

void relocate_hero (int xnew, int ynew)
void HeroModifyFirepower (int nDiff)
 Add some value to hero firepower.

bool check_solid (int ix, int iy, bool bCheckThings=true)
 Return true if solid. bCheckThings is an ugly hack which (fixme) should be fixed.

bool CheckCollision (int x1, int y1, int x2, int y2, bool bBullet=false)
 Return true if given rectangle [pixel coordinates] is colliding with anything solid.

int game_startup ()
void parse_level ()
void sprite_factory (unsigned char a, unsigned char b, int ix, int iy, int ifore, bool bfromlevel)
int move_hero (int xdiff, int ydiff, bool bChangeLookDirection=true)
void update_score (int score_diff, int nFloatingScoreX=-1, int nFloatingScoreY=-1)
void update_health (int health_diff)
void HeroSetHurting (bool bReset=false)
 Set the hero state to "hurting", unless already hurting, unless bReset is set to true.

bool HeroIsHurting ()
 Return true if hero is "hurting" (flashing).


Variables

vector<CThing *> g_apThings
SOUND_HANDLE g_iSounds [SOUND_MAX]
int x
int y
int xo
int yo
int x_small
int xo_small
int anim4_count
 Global 4-animation-frame animation count. This name must also change.


Detailed Description

The control of the game itself.

Author:
David Joffe


http://www.scorpioncity.com/djgame.html
Copyright (C) David Joffe. Generated: 15 Jul 2001