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 @@ #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; |