Last change
on this file since 208 was 160, checked in by dmik, 19 years ago |
Imported table and iconview modules and a bunch of dependent examples from the official release 3.3.1 from Trolltech.
|
-
Property svn:keywords
set to
Id
|
File size:
1.6 KB
|
Line | |
---|
1 | /*
|
---|
2 | * KAsteroids - Copyright (c) Martin R. Jones 1997
|
---|
3 | *
|
---|
4 | * Part of the KDE project
|
---|
5 | */
|
---|
6 |
|
---|
7 | #ifndef __KAST_TOPLEVEL_H__
|
---|
8 | #define __KAST_TOPLEVEL_H__
|
---|
9 |
|
---|
10 | #include <qmainwindow.h>
|
---|
11 | #include <qdict.h>
|
---|
12 | #include <qmap.h>
|
---|
13 |
|
---|
14 | #include "view.h"
|
---|
15 |
|
---|
16 |
|
---|
17 | class KALedMeter;
|
---|
18 | class QLCDNumber;
|
---|
19 |
|
---|
20 | class KAstTopLevel : public QMainWindow
|
---|
21 | {
|
---|
22 | Q_OBJECT
|
---|
23 | public:
|
---|
24 | KAstTopLevel( QWidget *parent=0, const char *name=0 );
|
---|
25 | virtual ~KAstTopLevel();
|
---|
26 |
|
---|
27 | private:
|
---|
28 | void playSound( const char *snd );
|
---|
29 | void readSoundMapping();
|
---|
30 | void doStats();
|
---|
31 |
|
---|
32 | protected:
|
---|
33 | virtual void showEvent( QShowEvent * );
|
---|
34 | virtual void hideEvent( QHideEvent * );
|
---|
35 | virtual void keyPressEvent( QKeyEvent *event );
|
---|
36 | virtual void keyReleaseEvent( QKeyEvent *event );
|
---|
37 |
|
---|
38 | private slots:
|
---|
39 | void slotNewGame();
|
---|
40 |
|
---|
41 | void slotShipKilled();
|
---|
42 | void slotRockHit( int size );
|
---|
43 | void slotRocksRemoved();
|
---|
44 |
|
---|
45 | void slotUpdateVitals();
|
---|
46 |
|
---|
47 | private:
|
---|
48 | KAsteroidsView *view;
|
---|
49 | QLCDNumber *scoreLCD;
|
---|
50 | QLCDNumber *levelLCD;
|
---|
51 | QLCDNumber *shipsLCD;
|
---|
52 |
|
---|
53 | QLCDNumber *teleportsLCD;
|
---|
54 | // QLCDNumber *bombsLCD;
|
---|
55 | QLCDNumber *brakesLCD;
|
---|
56 | QLCDNumber *shieldLCD;
|
---|
57 | QLCDNumber *shootLCD;
|
---|
58 | KALedMeter *powerMeter;
|
---|
59 |
|
---|
60 | bool sound;
|
---|
61 | QDict<QString> soundDict;
|
---|
62 |
|
---|
63 | // waiting for user to press Enter to launch a ship
|
---|
64 | bool waitShip;
|
---|
65 | bool isPaused;
|
---|
66 |
|
---|
67 | int shipsRemain;
|
---|
68 | int score;
|
---|
69 | int level;
|
---|
70 | bool showHiscores;
|
---|
71 |
|
---|
72 | enum Action { Launch, Thrust, RotateLeft, RotateRight, Shoot, Teleport,
|
---|
73 | Brake, Shield, Pause, NewGame };
|
---|
74 |
|
---|
75 | QMap<int,Action> actions;
|
---|
76 | };
|
---|
77 |
|
---|
78 | #endif
|
---|
79 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.