summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave/sfcave.h
authorandyq <andyq>2002-11-16 17:25:06 (UTC)
committer andyq <andyq>2002-11-16 17:25:06 (UTC)
commita2fb2e7a48b4f52f0eb19ab1f6c18f16ae6bfe11 (patch) (unidiff)
treee3be33241e9835ce5eee9e60ef95fcd7ce2a2152 /noncore/games/sfcave/sfcave.h
parent5e1846c71ae7d5254961a52862978f155fe764cf (diff)
downloadopie-a2fb2e7a48b4f52f0eb19ab1f6c18f16ae6bfe11.zip
opie-a2fb2e7a48b4f52f0eb19ab1f6c18f16ae6bfe11.tar.gz
opie-a2fb2e7a48b4f52f0eb19ab1f6c18f16ae6bfe11.tar.bz2
Initial release of SFCave for the Zaurus
Diffstat (limited to 'noncore/games/sfcave/sfcave.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/sfcave/sfcave.h76
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 @@
1#include <qmainwindow.h>
2#include <qpainter.h>
3#include <qpixmap.h>
4#include <qpoint.h>
5#include <qrect.h>
6#include <qtimer.h>
7
8
9
10#define MAPSIZE 52
11#define BLOCKSIZE 5
12#define TRAILSIZE 30
13
14#define STATE_BOSS 0
15#define STATE_RUNNING 1
16#define STATE_CRASHED 2
17#define STATE_NEWGAME 3
18
19class Main : public QMainWindow
20{
21Q_OBJECT
22
23public:
24 int sWidth;
25 int sHeight;
26 int segSize;
27
28 int blockWidth;
29 int blockHeight;
30 int state;
31 int prevState;
32 int speed;
33 int crashLineLength;
34
35 QPixmap *offscreen;
36 QTimer *gameTimer;
37
38 int score;
39 int highestScore;
40
41 int mapTop[52];
42 int mapBottom[52];
43 QRect blocks[5];
44 QRect user;
45 QPoint trail[30];
46
47 int offset;
48 int maxHeight;
49 int nrFrames;
50 int dir;
51
52 bool bossMode;
53
54 bool press;
55 double thrust;
56 bool running;
57
58 Main( int speed = 3, QWidget *p = 0, char *name = 0 );
59 ~Main();
60 void start();
61 int nextInt( int range );
62 void setUp();
63 bool checkCollision();
64 void moveLandscape();
65 void addBlock();
66 void setPoint( int point );
67 void drawBoss();
68 void draw();
69 void handleKeys();
70
71 void keyPressEvent( QKeyEvent *e );
72 void keyReleaseEvent( QKeyEvent *e );
73
74private slots:
75 void run();
76};