Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GatesGame Class Reference

#include </home/clem/local/src/opie/noncore/games/sfcave-sdl/gates_game.h>

Inheritance diagram for GatesGame:

Inheritance graph
[legend]
Collaboration diagram for GatesGame:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GatesGame (SFCave *p, int w, int h, int diff)
 ~GatesGame ()
void init ()
void update (int state)
void draw (SDL_Surface *screen)

Private Member Functions

void addGate ()
void moveBlocks (int amountToMove)
void drawBlocks (SDL_Surface *screen)
bool checkCollisions ()

Private Attributes

int gapHeight
int gateDistance
int nextGate
int lastGateBottomY
int blockDistance
int blockHeight
int blockWidth
int blockUpdateRate
Rect blocks [BLOCKSIZE]

Constructor & Destructor Documentation

GatesGame::GatesGame SFCave p,
int  w,
int  h,
int  diff
 

Definition at line 7 of file gates_game.cpp.

References blockUpdateRate, Game::difficulty, Game::gameName, Game::highScore, MENU_DIFFICULTY_EASY, Player, Game::player, and Game::terrain.

GatesGame::~GatesGame  ) 
 

Definition at line 19 of file gates_game.cpp.


Member Function Documentation

void GatesGame::addGate  )  [private]
 

Definition at line 131 of file gates_game.cpp.

References blocks, BLOCKSIZE, blockWidth, gapHeight, Terrain::getMapBottom(), Terrain::getMapTop(), i, lastGateBottomY, nextInt, printf, Rect::setRect(), Game::sWidth, Game::terrain, and Opie::MM::y.

Referenced by update().

bool GatesGame::checkCollisions  )  [private]
 

Definition at line 188 of file gates_game.cpp.

References blocks, BLOCKSIZE, Terrain::checkCollision(), Player::getHeight(), Player::getPos(), Player::getX(), Player::getY(), i, Game::player, Game::terrain, and Opie::MM::y.

Referenced by update().

void GatesGame::draw SDL_Surface *  screen  )  [virtual]
 

Reimplemented from Game.

Definition at line 104 of file gates_game.cpp.

References Game::draw(), Player::draw(), drawBlocks(), Terrain::drawTerrain(), SFCave::getState(), Game::parent, Game::player, Game::preDraw(), STATE_PLAYING, and Game::terrain.

void GatesGame::drawBlocks SDL_Surface *  screen  )  [private]
 

Definition at line 176 of file gates_game.cpp.

References blocks, BLOCKSIZE, Rect::getRect(), i, and Opie::MM::y.

Referenced by draw().

void GatesGame::init  )  [virtual]
 

Reimplemented from Game.

Definition at line 24 of file gates_game.cpp.

References blockHeight, blocks, BLOCKSIZE, blockWidth, Game::difficulty, gapHeight, gateDistance, i, Game::init(), lastGateBottomY, SFCave::loadDoubleSetting(), SFCave::loadIntSetting(), MENU_DIFFICULTY_CUSTOM, MENU_DIFFICULTY_EASY, MENU_DIFFICULTY_HARD, MENU_DIFFICULTY_NORMAL, nextGate, nextInt, Game::parent, Game::player, Player::setMovementInfo(), and Rect::y().

void GatesGame::moveBlocks int  amountToMove  )  [private]
 

Definition at line 163 of file gates_game.cpp.

References blocks, BLOCKSIZE, i, Rect::moveBy(), Opie::MM::x, Rect::y(), and Opie::MM::y.

Referenced by update().

void GatesGame::update int  state  )  [virtual]
 

Reimplemented from Game.

Definition at line 69 of file gates_game.cpp.

References addGate(), SFCave::changeState(), checkCollisions(), gapHeight, gateDistance, Player::move(), moveBlocks(), Terrain::moveTerrain(), nextGate, nextInt, Game::nrFrames, Game::parent, Game::player, Game::press, Game::score, STATE_CRASHING, STATE_PLAYING, Game::terrain, and Game::update().


Member Data Documentation

int GatesGame::blockDistance [private]
 

Definition at line 31 of file gates_game.h.

int GatesGame::blockHeight [private]
 

Definition at line 32 of file gates_game.h.

Referenced by init().

Rect GatesGame::blocks[BLOCKSIZE] [private]
 

Definition at line 36 of file gates_game.h.

Referenced by addGate(), checkCollisions(), drawBlocks(), init(), and moveBlocks().

int GatesGame::blockUpdateRate [private]
 

Definition at line 34 of file gates_game.h.

Referenced by GatesGame().

int GatesGame::blockWidth [private]
 

Definition at line 33 of file gates_game.h.

Referenced by addGate(), and init().

int GatesGame::gapHeight [private]
 

Definition at line 25 of file gates_game.h.

Referenced by addGate(), init(), and update().

int GatesGame::gateDistance [private]
 

Definition at line 27 of file gates_game.h.

Referenced by init(), and update().

int GatesGame::lastGateBottomY [private]
 

Definition at line 29 of file gates_game.h.

Referenced by addGate(), and init().

int GatesGame::nextGate [private]
 

Definition at line 28 of file gates_game.h.

Referenced by init(), and update().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:33:36 2005 for OPIE by  doxygen 1.4.2