summaryrefslogtreecommitdiff
path: root/noncore/games/parashoot/man.cpp
Side-by-side diff
Diffstat (limited to 'noncore/games/parashoot/man.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/parashoot/man.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/noncore/games/parashoot/man.cpp b/noncore/games/parashoot/man.cpp
index 8435572..94807c2 100644
--- a/noncore/games/parashoot/man.cpp
+++ b/noncore/games/parashoot/man.cpp
@@ -1,5 +1,5 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
@@ -24,3 +24,3 @@
-#include <qpe/resource.h>
+#include <qtopia/resource.h>
@@ -32,3 +32,3 @@ Man::Man(QCanvas* canvas) :
QCanvasSprite(0, canvas),
- splat("lose")
+ splat("lose") // No tr
{
@@ -47,3 +47,3 @@ Man::Man(QCanvas* canvas, int x, int y) :
QCanvasSprite(0, canvas),
- splat("bang")
+ splat("bang") // No tr
{
@@ -94,2 +94,9 @@ void Man::advance(int phase)
setVelocity(-2, 0);
+ } else if (xVelocity() == -2) {
+ //
+ // There's been a resize event while this Man has
+ // been on the ground. Move the man back to the
+ // new ground location. This is not neat.
+ //
+ move(x(), canvas()->height()-26);
}
@@ -125,2 +132,12 @@ void Man::checkCollision()
}
+
+ //
+ // resize events may cause Man objects to appear
+ // outside the screen. Get rid of them if this
+ // is the case.
+ //
+ if ((x() < 0) || (x() > canvas()->width())) {
+ delete this;
+ return;
+ }
}