00001 #ifndef __GATES_GAME_H 00002 #define __GATES_GAME_H 00003 00004 #include <SDL/SDL.h> 00005 00006 #include "rect.h" 00007 00008 #include "sfcave.h" 00009 #include "terrain.h" 00010 #include "player.h" 00011 #include "game.h" 00012 00013 class GatesGame : public Game 00014 { 00015 public: 00016 GatesGame( SFCave *p, int w, int h, int diff ); 00017 ~GatesGame(); 00018 00019 void init(); 00020 void update( int state ); 00021 void draw( SDL_Surface *screen ); 00022 00023 private: 00024 00025 int gapHeight; 00026 00027 int gateDistance; 00028 int nextGate; 00029 int lastGateBottomY; 00030 00031 int blockDistance; 00032 int blockHeight; 00033 int blockWidth; 00034 int blockUpdateRate; 00035 00036 Rect blocks[BLOCKSIZE]; 00037 00038 void addGate(); 00039 void moveBlocks( int amountToMove ); 00040 void drawBlocks( SDL_Surface *screen ); 00041 bool checkCollisions(); 00042 00043 }; 00044 00045 #endif
1.4.2