summaryrefslogtreecommitdiff
path: root/noncore/games/parashoot
Side-by-side diff
Diffstat (limited to 'noncore/games/parashoot') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/parashoot/interface.cpp33
-rw-r--r--noncore/games/parashoot/interface.h1
-rw-r--r--noncore/games/parashoot/main.cpp13
-rw-r--r--noncore/games/parashoot/opie-parashoot.control2
-rw-r--r--noncore/games/parashoot/parashoot.pro6
5 files changed, 25 insertions, 30 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
@@ -24,2 +24,3 @@
#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
@@ -31,3 +32,3 @@
#include <qtoolbutton.h>
-
+
ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
@@ -38,2 +39,4 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
{
+ QPEApplication::grabKeyboard();
+ QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff );
canvas.setAdvancePeriod(80);
@@ -61,3 +64,3 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
showScore(0,0);
-
+
setCentralWidget(pb);
@@ -66,5 +69,5 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
connect (autoDropTimer, SIGNAL(timeout()), this, SLOT(play()) );
-
+
pauseTimer = new QTimer(this);
- connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) );
+ connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) );
@@ -93,3 +96,3 @@ void ParaShoot::newGame()
clear();
- if (pauseTimer->isActive())
+ if (pauseTimer->isActive())
pauseTimer->stop();
@@ -121,3 +124,3 @@ void ParaShoot::clear()
for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
- delete *it;
+ delete *it;
}
@@ -129,3 +132,3 @@ void ParaShoot::gameOver()
QCanvasItemList l = canvas.allItems();
- for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
+ for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
item = *it;
@@ -140,3 +143,3 @@ void ParaShoot::gameOver()
int shotsFired = cannon->shotsFired();
- if ( shotsFired == 0 )
+ if ( shotsFired == 0 )
shotsFired = 1;
@@ -146,3 +149,3 @@ void ParaShoot::gameOver()
" Parachuters Killed: %2\n"
- " Accuracy: %3% " ).arg(score).arg(shots).arg(shots * 100 / shotsFired ),
+ " Accuracy: %3% " ).arg(score).arg(shots).arg(shots * 100 / shotsFired ),
&canvas);
@@ -165,3 +168,3 @@ void ParaShoot::wait()
void ParaShoot::play()
-{
+{
if (Man::getManCount() < nomen ) {
@@ -179,3 +182,3 @@ void ParaShoot::increaseScore(int x)
if ( score / 150 != (score-x) / 150 )
- levelUp();
+ levelUp();
showScore(level,score);
@@ -185,3 +188,3 @@ void ParaShoot::levelUp()
{
- level++;
+ level++;
int stage = level % 3;
@@ -195,3 +198,3 @@ void ParaShoot::levelUp()
new Helicopter(&canvas);
- break;
+ break;
case 2:
@@ -199,3 +202,3 @@ void ParaShoot::levelUp()
fanfare.play();
- break;
+ break;
default: return;
@@ -218,3 +221,3 @@ void ParaShoot::keyPressEvent(QKeyEvent* event)
newGame();
- else
+ else
return;
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
@@ -40,2 +40,3 @@ class ParaShoot : public QMainWindow {
public:
+ static QString appName() { return QString::fromLatin1("parashoot"); }
ParaShoot(QWidget* parent=0, const char* name=0, WFlags f=0);
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
@@ -23,14 +23,5 @@
#include <qpe/qpeapplication.h>
+#include <opie/oapplicationfactory.h>
-int main(int argc, char **argv)
-{
- QPEApplication app(argc,argv);
+OPIE_EXPORT_APP( OApplicationFactory<ParaShoot> )
- QPEApplication::grabKeyboard();
-
- ParaShoot m;
- QPEApplication::setInputMethodHint( &m, QPEApplication::AlwaysOff );
- app.showMainWidget(&m);
-
- return app.exec();
-}
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,3 +1,3 @@
Package: opie-parashoot
-Files: bin/parashoot apps/Games/parashoot.desktop pics/parashoot
+Files: plugins/application/libparashoot.so* bin/parashoot apps/Games/parashoot.desktop pics/parashoot
Priority: optional
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,4 +1,2 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
HEADERS = interface.h man.h cannon.h base.h bullet.h helicopter.h
@@ -10,2 +8,4 @@ LIBS += -lqpe
+
+
include ( $(OPIEDIR)/include.pro )