-rw-r--r-- | noncore/games/parashoot/interface.cpp | 3 | ||||
-rw-r--r-- | noncore/games/parashoot/interface.h | 1 | ||||
-rw-r--r-- | noncore/games/parashoot/main.cpp | 13 | ||||
-rw-r--r-- | noncore/games/parashoot/opie-parashoot.control | 2 | ||||
-rw-r--r-- | noncore/games/parashoot/parashoot.pro | 6 |
5 files changed, 10 insertions, 15 deletions
diff --git a/noncore/games/parashoot/interface.cpp b/noncore/games/parashoot/interface.cpp index db98720..a40426d 100644 --- a/noncore/games/parashoot/interface.cpp +++ b/noncore/games/parashoot/interface.cpp | |||
@@ -13,38 +13,41 @@ | |||
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "interface.h" | 21 | #include "interface.h" |
22 | #include "man.h" | 22 | #include "man.h" |
23 | 23 | ||
24 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
25 | #include <qpe/qpeapplication.h> | ||
25 | 26 | ||
26 | #include <qlabel.h> | 27 | #include <qlabel.h> |
27 | #include <qmessagebox.h> | 28 | #include <qmessagebox.h> |
28 | #include <qapplication.h> | 29 | #include <qapplication.h> |
29 | #include <qstyle.h> | 30 | #include <qstyle.h> |
30 | #include <qpe/qpetoolbar.h> | 31 | #include <qpe/qpetoolbar.h> |
31 | #include <qtoolbutton.h> | 32 | #include <qtoolbutton.h> |
32 | 33 | ||
33 | ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : | 34 | ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : |
34 | QMainWindow(parent,name,f), | 35 | QMainWindow(parent,name,f), |
35 | canvas(232, 258), | 36 | canvas(232, 258), |
36 | fanfare("level_up"), | 37 | fanfare("level_up"), |
37 | score(0) | 38 | score(0) |
38 | { | 39 | { |
40 | QPEApplication::grabKeyboard(); | ||
41 | QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff ); | ||
39 | canvas.setAdvancePeriod(80); | 42 | canvas.setAdvancePeriod(80); |
40 | QPixmap bg = Resource::loadPixmap("parashoot/sky"); | 43 | QPixmap bg = Resource::loadPixmap("parashoot/sky"); |
41 | canvas.setBackgroundPixmap(bg); | 44 | canvas.setBackgroundPixmap(bg); |
42 | 45 | ||
43 | pb = new QCanvasView(&canvas, this); | 46 | pb = new QCanvasView(&canvas, this); |
44 | pb->setFocus(); | 47 | pb->setFocus(); |
45 | 48 | ||
46 | setToolBarsMovable( FALSE ); | 49 | setToolBarsMovable( FALSE ); |
47 | 50 | ||
48 | QToolBar* toolbar = new QToolBar(this); | 51 | QToolBar* toolbar = new QToolBar(this); |
49 | toolbar->setHorizontalStretchable( TRUE ); | 52 | toolbar->setHorizontalStretchable( TRUE ); |
50 | 53 | ||
diff --git a/noncore/games/parashoot/interface.h b/noncore/games/parashoot/interface.h index 3f36d0b..5abbe0b 100644 --- a/noncore/games/parashoot/interface.h +++ b/noncore/games/parashoot/interface.h | |||
@@ -29,24 +29,25 @@ | |||
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"); } | ||
41 | ParaShoot(QWidget* parent=0, const char* name=0, WFlags f=0); | 42 | ParaShoot(QWidget* parent=0, const char* name=0, WFlags f=0); |
42 | 43 | ||
43 | void clear(); | 44 | void clear(); |
44 | void gameOver(); | 45 | void gameOver(); |
45 | int mancount; | 46 | int mancount; |
46 | void levelUp(); | 47 | void levelUp(); |
47 | void moveFaster(); | 48 | void moveFaster(); |
48 | 49 | ||
49 | protected: | 50 | protected: |
50 | virtual void keyPressEvent(QKeyEvent*); | 51 | virtual void keyPressEvent(QKeyEvent*); |
51 | virtual void keyReleaseEvent(QKeyEvent*); | 52 | virtual void keyReleaseEvent(QKeyEvent*); |
52 | virtual void resizeEvent(QResizeEvent *e); | 53 | virtual void resizeEvent(QResizeEvent *e); |
diff --git a/noncore/games/parashoot/main.cpp b/noncore/games/parashoot/main.cpp index 60eea18..ee36d26 100644 --- a/noncore/games/parashoot/main.cpp +++ b/noncore/games/parashoot/main.cpp | |||
@@ -12,25 +12,16 @@ | |||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "interface.h" | 21 | #include "interface.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <opie/oapplicationfactory.h> | ||
24 | 25 | ||
25 | int main(int argc, char **argv) | 26 | OPIE_EXPORT_APP( OApplicationFactory<ParaShoot> ) |
26 | { | ||
27 | QPEApplication app(argc,argv); | ||
28 | 27 | ||
29 | QPEApplication::grabKeyboard(); | ||
30 | |||
31 | ParaShoot m; | ||
32 | QPEApplication::setInputMethodHint( &m, QPEApplication::AlwaysOff ); | ||
33 | app.showMainWidget(&m); | ||
34 | |||
35 | return app.exec(); | ||
36 | } | ||
diff --git a/noncore/games/parashoot/opie-parashoot.control b/noncore/games/parashoot/opie-parashoot.control index 758d24d..139dd3c 100644 --- a/noncore/games/parashoot/opie-parashoot.control +++ b/noncore/games/parashoot/opie-parashoot.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-parashoot | 1 | Package: opie-parashoot |
2 | Files: bin/parashoot apps/Games/parashoot.desktop pics/parashoot | 2 | Files: plugins/application/libparashoot.so* bin/parashoot apps/Games/parashoot.desktop pics/parashoot |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/games | 4 | Section: opie/games |
5 | Maintainer: Martin Imobersteg <imm@gmx.ch> | 5 | Maintainer: Martin Imobersteg <imm@gmx.ch> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
8 | Description: Game: shoot the parachutists | 8 | Description: Game: shoot the parachutists |
9 | A game for the Opie environment. | 9 | A game for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | 10 | Version: $QPE_VERSION$EXTRAVERSION |
diff --git a/noncore/games/parashoot/parashoot.pro b/noncore/games/parashoot/parashoot.pro index c2746f9..f5d103a 100644 --- a/noncore/games/parashoot/parashoot.pro +++ b/noncore/games/parashoot/parashoot.pro | |||
@@ -1,11 +1,11 @@ | |||
1 | TEMPLATE= app | 1 | CONFIG += qt warn_on release quick-app |
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = interface.h man.h cannon.h base.h bullet.h helicopter.h | 2 | HEADERS = interface.h man.h cannon.h base.h bullet.h helicopter.h |
5 | SOURCES = main.cpp interface.cpp man.cpp cannon.cpp base.cpp bullet.cpp helicopter.cpp | 3 | SOURCES = main.cpp interface.cpp man.cpp cannon.cpp base.cpp bullet.cpp helicopter.cpp |
6 | TARGET = parashoot | 4 | TARGET = parashoot |
7 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH+= $(OPIEDIR)/include | 6 | DEPENDPATH+= $(OPIEDIR)/include |
9 | LIBS += -lqpe | 7 | LIBS += -lqpe |
10 | 8 | ||
9 | |||
10 | |||
11 | include ( $(OPIEDIR)/include.pro ) | 11 | include ( $(OPIEDIR)/include.pro ) |