Diffstat (limited to 'noncore/games/parashoot/interface.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/parashoot/interface.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/noncore/games/parashoot/interface.h b/noncore/games/parashoot/interface.h index 5abbe0b..dd73f53 100644 --- a/noncore/games/parashoot/interface.h +++ b/noncore/games/parashoot/interface.h | |||
@@ -1,12 +1,12 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
@@ -17,64 +17,66 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "cannon.h" | 21 | #include "cannon.h" |
22 | #include "base.h" | 22 | #include "base.h" |
23 | #include "helicopter.h" | 23 | #include "helicopter.h" |
24 | 24 | ||
25 | #include <qpe/sound.h> | 25 | #include <qtopia/sound.h> |
26 | 26 | ||
27 | #include <qmainwindow.h> | 27 | #include <qmainwindow.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | 30 | ||
31 | class QCanvas; | 31 | class QCanvas; |
32 | class Helicopter; | 32 | class Helicopter; |
33 | 33 | ||
34 | //enum Direction{ | 34 | //enum Direction{ |
35 | // left, right, up, down }; | 35 | // left, right, up, down }; |
36 | 36 | ||
37 | class ParaShoot : public QMainWindow { | 37 | class ParaShoot : public QMainWindow { |
38 | Q_OBJECT | 38 | Q_OBJECT |
39 | 39 | ||
40 | public: | 40 | public: |
41 | static QString appName() { return QString::fromLatin1("parashoot"); } | ||
42 | ParaShoot(QWidget* parent=0, const char* name=0, WFlags f=0); | 41 | ParaShoot(QWidget* parent=0, const char* name=0, WFlags f=0); |
43 | 42 | static QString appName() { | |
43 | return QString::fromLatin1("parashoot"); | ||
44 | } | ||
44 | void clear(); | 45 | void clear(); |
45 | void gameOver(); | 46 | void gameOver(); |
46 | int mancount; | 47 | int mancount; |
47 | void levelUp(); | 48 | void levelUp(); |
48 | void moveFaster(); | 49 | void moveFaster(); |
49 | 50 | ||
50 | protected: | 51 | protected: |
51 | virtual void keyPressEvent(QKeyEvent*); | 52 | virtual void keyPressEvent(QKeyEvent*); |
52 | virtual void keyReleaseEvent(QKeyEvent*); | 53 | virtual void keyReleaseEvent(QKeyEvent*); |
53 | virtual void resizeEvent(QResizeEvent *e); | 54 | virtual void resizeEvent(QResizeEvent *e); |
54 | 55 | virtual void focusOutEvent(QFocusEvent *); | |
56 | virtual void focusInEvent(QFocusEvent *); | ||
57 | |||
55 | private slots: | 58 | private slots: |
56 | void increaseScore(int); | 59 | void increaseScore(int); |
57 | void newGame(); | 60 | void newGame(); |
58 | void play(); | 61 | void play(); |
59 | void wait(); | 62 | void wait(); |
60 | 63 | ||
61 | private: | 64 | private: |
62 | void showScore( int score, int level ); | 65 | void showScore( int score, int level ); |
63 | QCanvasView* pb; | 66 | QCanvasView* pb; |
64 | QCanvas canvas; | 67 | QCanvas canvas; |
65 | Cannon* cannon; | 68 | Cannon* cannon; |
66 | Base* base; | 69 | Base* base; |
67 | QCanvasText* gameover; | ||
68 | QLabel* levelscore; | 70 | QLabel* levelscore; |
69 | int nomen; | 71 | int nomen; |
70 | int level; | 72 | int level; |
71 | int oldscore; | 73 | int oldscore; |
72 | int updatespeed; | 74 | int updatespeed; |
73 | QTimer* autoDropTimer; | 75 | QTimer* autoDropTimer; |
74 | QTimer* pauseTimer; | 76 | QTimer* pauseTimer; |
75 | bool gamestopped; | 77 | bool gamestopped; |
76 | bool waitover; | 78 | bool waitover; |
77 | Sound fanfare; | 79 | Sound fanfare; |
78 | int score; | 80 | int score; |
79 | int lastcannonkey; | 81 | int lastcannonkey; |
80 | }; | 82 | }; |