author | andyq <andyq> | 2002-11-16 17:25:06 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-11-16 17:25:06 (UTC) |
commit | a2fb2e7a48b4f52f0eb19ab1f6c18f16ae6bfe11 (patch) (side-by-side diff) | |
tree | e3be33241e9835ce5eee9e60ef95fcd7ce2a2152 /noncore/games/sfcave/sfcave.h | |
parent | 5e1846c71ae7d5254961a52862978f155fe764cf (diff) | |
download | opie-a2fb2e7a48b4f52f0eb19ab1f6c18f16ae6bfe11.zip opie-a2fb2e7a48b4f52f0eb19ab1f6c18f16ae6bfe11.tar.gz opie-a2fb2e7a48b4f52f0eb19ab1f6c18f16ae6bfe11.tar.bz2 |
Initial release of SFCave for the Zaurus
-rw-r--r-- | noncore/games/sfcave/sfcave.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/noncore/games/sfcave/sfcave.h b/noncore/games/sfcave/sfcave.h new file mode 100644 index 0000000..18eeef9 --- a/dev/null +++ b/noncore/games/sfcave/sfcave.h @@ -0,0 +1,76 @@ +#include <qmainwindow.h> +#include <qpainter.h> +#include <qpixmap.h> +#include <qpoint.h> +#include <qrect.h> +#include <qtimer.h> + + + +#define MAPSIZE 52 +#define BLOCKSIZE 5 +#define TRAILSIZE 30 + +#define STATE_BOSS 0 +#define STATE_RUNNING 1 +#define STATE_CRASHED 2 +#define STATE_NEWGAME 3 + +class Main : public QMainWindow +{ +Q_OBJECT + +public: + int sWidth; + int sHeight; + int segSize; + + int blockWidth; + int blockHeight; + int state; + int prevState; + int speed; + int crashLineLength; + + QPixmap *offscreen; + QTimer *gameTimer; + + int score; + int highestScore; + + int mapTop[52]; + int mapBottom[52]; + QRect blocks[5]; + QRect user; + QPoint trail[30]; + + int offset; + int maxHeight; + int nrFrames; + int dir; + + bool bossMode; + + bool press; + double thrust; + bool running; + + Main( int speed = 3, QWidget *p = 0, char *name = 0 ); + ~Main(); + void start(); + int nextInt( int range ); + void setUp(); + bool checkCollision(); + void moveLandscape(); + void addBlock(); + void setPoint( int point ); + void drawBoss(); + void draw(); + void handleKeys(); + + void keyPressEvent( QKeyEvent *e ); + void keyReleaseEvent( QKeyEvent *e ); + +private slots: + void run(); +}; |