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

SFCaveGame Class Reference

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

Inheritance diagram for SFCaveGame:

Inheritance graph
[legend]
Collaboration diagram for SFCaveGame:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Private Member Functions

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

Private Attributes

int blockDistance
int blockHeight
int blockWidth
int blockUpdateRate
Rect blocks [BLOCKSIZE]

Constructor & Destructor Documentation

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

Definition at line 7 of file sfcave_game.cpp.

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

SFCaveGame::~SFCaveGame  ) 
 

Definition at line 19 of file sfcave_game.cpp.


Member Function Documentation

void SFCaveGame::addBlock  )  [private]
 

Definition at line 124 of file sfcave_game.cpp.

References blockHeight, blocks, BLOCKSIZE, blockWidth, Terrain::getMapBottom(), Terrain::getMapTop(), i, MAPSIZE, nextInt, Rect::setRect(), Game::sWidth, Game::terrain, Opie::MM::x, and Opie::MM::y.

Referenced by update().

bool SFCaveGame::checkCollisions  )  [private]
 

Definition at line 166 of file sfcave_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 SFCaveGame::draw SDL_Surface *  screen  )  [virtual]
 

Reimplemented from Game.

Definition at line 98 of file sfcave_game.cpp.

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

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

Definition at line 154 of file sfcave_game.cpp.

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

Referenced by draw().

void SFCaveGame::init  )  [virtual]
 

Reimplemented from Game.

Definition at line 23 of file sfcave_game.cpp.

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

void SFCaveGame::moveBlocks int  amountToMove  )  [private]
 

Definition at line 141 of file sfcave_game.cpp.

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

Referenced by update().

void SFCaveGame::update int  state  )  [virtual]
 

Reimplemented from Game.

Definition at line 61 of file sfcave_game.cpp.

References addBlock(), blockDistance, blockHeight, SFCave::changeState(), checkCollisions(), Terrain::getMaxHeight(), Terrain::increaseMaxHeight(), Player::move(), moveBlocks(), Terrain::moveTerrain(), Game::nrFrames, Game::parent, Game::player, Game::press, Game::score, Game::sHeight, STATE_CRASHING, STATE_PLAYING, Game::terrain, and Game::update().


Member Data Documentation

int SFCaveGame::blockDistance [private]
 

Definition at line 25 of file sfcave_game.h.

Referenced by init(), and update().

int SFCaveGame::blockHeight [private]
 

Definition at line 26 of file sfcave_game.h.

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

Rect SFCaveGame::blocks[BLOCKSIZE] [private]
 

Definition at line 30 of file sfcave_game.h.

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

int SFCaveGame::blockUpdateRate [private]
 

Definition at line 28 of file sfcave_game.h.

Referenced by SFCaveGame().

int SFCaveGame::blockWidth [private]
 

Definition at line 27 of file sfcave_game.h.

Referenced by addBlock(), and init().


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