summaryrefslogtreecommitdiff
path: root/noncore/games/qasteroids/toplevel.h
Unidiff
Diffstat (limited to 'noncore/games/qasteroids/toplevel.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/qasteroids/toplevel.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/noncore/games/qasteroids/toplevel.h b/noncore/games/qasteroids/toplevel.h
new file mode 100644
index 0000000..4e1ac9c
--- a/dev/null
+++ b/noncore/games/qasteroids/toplevel.h
@@ -0,0 +1,99 @@
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 * KAsteroids - Copyright (c) Martin R. Jones 1997
21 *
22 * Part of the KDE project
23 */
24
25#ifndef __KAST_TOPLEVEL_H__
26#define __KAST_TOPLEVEL_H__
27
28#include <qmainwindow.h>
29#include <qdict.h>
30#include <qmap.h>
31
32#include "view.h"
33
34
35class KALedMeter;
36class QLCDNumber;
37
38class KAstTopLevel : public QMainWindow
39{
40 Q_OBJECT
41public:
42 KAstTopLevel( QWidget *parent=0, const char *name=0 );
43 virtual ~KAstTopLevel();
44
45private:
46 void playSound( const char *snd );
47 void readSoundMapping();
48 void doStats();
49
50protected:
51 virtual void showEvent( QShowEvent * );
52 virtual void hideEvent( QHideEvent * );
53 virtual void keyPressEvent( QKeyEvent *event );
54 virtual void keyReleaseEvent( QKeyEvent *event );
55 virtual void focusInEvent( QFocusEvent *event );
56 virtual void focusOutEvent( QFocusEvent *event );
57
58private slots:
59 void slotNewGame();
60
61 void slotShipKilled();
62 void slotRockHit( int size );
63 void slotRocksRemoved();
64
65 void slotUpdateVitals();
66
67private:
68 KAsteroidsView *view;
69 QLCDNumber *scoreLCD;
70 QLCDNumber *levelLCD;
71 QLCDNumber *shipsLCD;
72
73 QLCDNumber *teleportsLCD;
74// QLCDNumber *bombsLCD;
75 QLCDNumber *brakesLCD;
76 QLCDNumber *shieldLCD;
77 QLCDNumber *shootLCD;
78 KALedMeter *powerMeter;
79
80 bool sound;
81 QDict<QString> soundDict;
82
83 // waiting for user to press Enter to launch a ship
84 bool waitShip;
85 bool isPaused;
86
87 int shipsRemain;
88 int score;
89 int level;
90 bool showHiscores;
91
92 enum Action { Launch, Thrust, RotateLeft, RotateRight, Shoot, Teleport,
93 Brake, Shield, Pause, NewGame };
94
95 QMap<int,Action> actions;
96};
97
98#endif
99