Diffstat (limited to 'noncore/games/parashoot/cannon.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/parashoot/cannon.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/noncore/games/parashoot/cannon.h b/noncore/games/parashoot/cannon.h new file mode 100644 index 0000000..44d0c65 --- a/dev/null +++ b/noncore/games/parashoot/cannon.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #include <qcanvas.h> | ||
21 | |||
22 | #include "bullet.h" | ||
23 | |||
24 | class Cannon : public QObject, public QCanvasSprite | ||
25 | { | ||
26 | Q_OBJECT | ||
27 | |||
28 | public: | ||
29 | Cannon(QCanvas*); //create cannon | ||
30 | ~Cannon(); //destroy cannon | ||
31 | |||
32 | enum Direction{ Left, Right, NoDir }; | ||
33 | |||
34 | void pointCannon(Direction dir); | ||
35 | void setCoords(); | ||
36 | double shootAngle(); | ||
37 | void shoot(); | ||
38 | int rtti() const; | ||
39 | |||
40 | int shotsFired() { return shotsfired; }; | ||
41 | |||
42 | protected: | ||
43 | void advance(int stage); | ||
44 | |||
45 | signals: | ||
46 | void score(int); | ||
47 | |||
48 | private: | ||
49 | QCanvasPixmapArray* cannonarray; | ||
50 | int index; | ||
51 | int cannonx; | ||
52 | int cannony; | ||
53 | int barrelxpos; | ||
54 | int barrelypos; | ||
55 | int moveDelay; | ||
56 | Direction movedir; | ||
57 | int shotsfired; | ||
58 | }; | ||