Diffstat (limited to 'noncore/games/parashoot/interface.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/parashoot/interface.cpp | 33 |
1 files changed, 18 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 | |||
@@ -24,2 +24,3 @@ | |||
24 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
25 | #include <qpe/qpeapplication.h> | ||
25 | 26 | ||
@@ -31,3 +32,3 @@ | |||
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) : |
@@ -38,2 +39,4 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : | |||
38 | { | 39 | { |
40 | QPEApplication::grabKeyboard(); | ||
41 | QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff ); | ||
39 | canvas.setAdvancePeriod(80); | 42 | canvas.setAdvancePeriod(80); |
@@ -61,3 +64,3 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : | |||
61 | showScore(0,0); | 64 | showScore(0,0); |
62 | 65 | ||
63 | setCentralWidget(pb); | 66 | setCentralWidget(pb); |
@@ -66,5 +69,5 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : | |||
66 | connect (autoDropTimer, SIGNAL(timeout()), this, SLOT(play()) ); | 69 | connect (autoDropTimer, SIGNAL(timeout()), this, SLOT(play()) ); |
67 | 70 | ||
68 | pauseTimer = new QTimer(this); | 71 | pauseTimer = new QTimer(this); |
69 | connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) ); | 72 | connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) ); |
70 | 73 | ||
@@ -93,3 +96,3 @@ void ParaShoot::newGame() | |||
93 | clear(); | 96 | clear(); |
94 | if (pauseTimer->isActive()) | 97 | if (pauseTimer->isActive()) |
95 | pauseTimer->stop(); | 98 | pauseTimer->stop(); |
@@ -121,3 +124,3 @@ void ParaShoot::clear() | |||
121 | for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { | 124 | for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { |
122 | delete *it; | 125 | delete *it; |
123 | } | 126 | } |
@@ -129,3 +132,3 @@ void ParaShoot::gameOver() | |||
129 | QCanvasItemList l = canvas.allItems(); | 132 | QCanvasItemList l = canvas.allItems(); |
130 | for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { | 133 | for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { |
131 | item = *it; | 134 | item = *it; |
@@ -140,3 +143,3 @@ void ParaShoot::gameOver() | |||
140 | int shotsFired = cannon->shotsFired(); | 143 | int shotsFired = cannon->shotsFired(); |
141 | if ( shotsFired == 0 ) | 144 | if ( shotsFired == 0 ) |
142 | shotsFired = 1; | 145 | shotsFired = 1; |
@@ -146,3 +149,3 @@ void ParaShoot::gameOver() | |||
146 | " Parachuters Killed: %2\n" | 149 | " Parachuters Killed: %2\n" |
147 | " Accuracy: %3% " ).arg(score).arg(shots).arg(shots * 100 / shotsFired ), | 150 | " Accuracy: %3% " ).arg(score).arg(shots).arg(shots * 100 / shotsFired ), |
148 | &canvas); | 151 | &canvas); |
@@ -165,3 +168,3 @@ void ParaShoot::wait() | |||
165 | void ParaShoot::play() | 168 | void ParaShoot::play() |
166 | { | 169 | { |
167 | if (Man::getManCount() < nomen ) { | 170 | if (Man::getManCount() < nomen ) { |
@@ -179,3 +182,3 @@ void ParaShoot::increaseScore(int x) | |||
179 | if ( score / 150 != (score-x) / 150 ) | 182 | if ( score / 150 != (score-x) / 150 ) |
180 | levelUp(); | 183 | levelUp(); |
181 | showScore(level,score); | 184 | showScore(level,score); |
@@ -185,3 +188,3 @@ void ParaShoot::levelUp() | |||
185 | { | 188 | { |
186 | level++; | 189 | level++; |
187 | int stage = level % 3; | 190 | int stage = level % 3; |
@@ -195,3 +198,3 @@ void ParaShoot::levelUp() | |||
195 | new Helicopter(&canvas); | 198 | new Helicopter(&canvas); |
196 | break; | 199 | break; |
197 | case 2: | 200 | case 2: |
@@ -199,3 +202,3 @@ void ParaShoot::levelUp() | |||
199 | fanfare.play(); | 202 | fanfare.play(); |
200 | break; | 203 | break; |
201 | default: return; | 204 | default: return; |
@@ -218,3 +221,3 @@ void ParaShoot::keyPressEvent(QKeyEvent* event) | |||
218 | newGame(); | 221 | newGame(); |
219 | else | 222 | else |
220 | return; | 223 | return; |