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,6 +1,6 @@
/**********************************************************************
-** 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.
**
** This file may be distributed and/or modified under the terms of the
@@ -23,5 +23,5 @@
#include "base.h"
-#include <qpe/resource.h>
+#include <qtopia/resource.h>
#include <qregexp.h>
@@ -31,5 +31,5 @@ int mancount;
Man::Man(QCanvas* canvas) :
QCanvasSprite(0, canvas),
- splat("lose")
+ splat("lose") // No tr
{
manarray = new QCanvasPixmapArray();
@@ -46,5 +46,5 @@ Man::Man(QCanvas* canvas) :
Man::Man(QCanvas* canvas, int x, int y) :
QCanvasSprite(0, canvas),
- splat("bang")
+ splat("bang") // No tr
{
manarray = new QCanvasPixmapArray();
@@ -93,4 +93,11 @@ void Man::advance(int phase)
move(x(), canvas()->height()-26);
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);
}
}
@@ -124,4 +131,14 @@ 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;
+ }
}