Diffstat (limited to 'noncore/games/parashoot/man.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/parashoot/man.cpp | 27 |
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 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
@@ -24,3 +24,3 @@ | |||
24 | 24 | ||
25 | #include <qpe/resource.h> | 25 | #include <qtopia/resource.h> |
26 | 26 | ||
@@ -32,3 +32,3 @@ Man::Man(QCanvas* canvas) : | |||
32 | QCanvasSprite(0, canvas), | 32 | QCanvasSprite(0, canvas), |
33 | splat("lose") | 33 | splat("lose") // No tr |
34 | { | 34 | { |
@@ -47,3 +47,3 @@ Man::Man(QCanvas* canvas, int x, int y) : | |||
47 | QCanvasSprite(0, canvas), | 47 | QCanvasSprite(0, canvas), |
48 | splat("bang") | 48 | splat("bang") // No tr |
49 | { | 49 | { |
@@ -94,2 +94,9 @@ void Man::advance(int phase) | |||
94 | setVelocity(-2, 0); | 94 | setVelocity(-2, 0); |
95 | } else if (xVelocity() == -2) { | ||
96 | // | ||
97 | // There's been a resize event while this Man has | ||
98 | // been on the ground. Move the man back to the | ||
99 | // new ground location. This is not neat. | ||
100 | // | ||
101 | move(x(), canvas()->height()-26); | ||
95 | } | 102 | } |
@@ -125,2 +132,12 @@ void Man::checkCollision() | |||
125 | } | 132 | } |
133 | |||
134 | // | ||
135 | // resize events may cause Man objects to appear | ||
136 | // outside the screen. Get rid of them if this | ||
137 | // is the case. | ||
138 | // | ||
139 | if ((x() < 0) || (x() > canvas()->width())) { | ||
140 | delete this; | ||
141 | return; | ||
142 | } | ||
126 | } | 143 | } |