summaryrefslogtreecommitdiff
path: root/noncore/games/parashoot/man.cpp
Unidiff
Diffstat (limited to 'noncore/games/parashoot/man.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/parashoot/man.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/noncore/games/parashoot/man.cpp b/noncore/games/parashoot/man.cpp
index 0a151b0..080615e 100644
--- a/noncore/games/parashoot/man.cpp
+++ b/noncore/games/parashoot/man.cpp
@@ -1,74 +1,73 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "codes.h" 21#include "codes.h"
22#include "man.h" 22#include "man.h"
23#include "base.h" 23#include "base.h"
24 24
25#include <qtopia/resource.h> 25#include <opie2/oresource.h>
26
27 26
28int mancount; 27int mancount;
29 28
30Man::Man(QCanvas* canvas) : 29Man::Man(QCanvas* canvas) :
31 QCanvasSprite(0, canvas), 30 QCanvasSprite(0, canvas),
32 splat("lose") // No tr 31 splat("lose") // No tr
33{ 32{
34 manarray = new QCanvasPixmapArray(); 33 manarray = new QCanvasPixmapArray();
35 QString m0 = Resource::findPixmap("parashoot/man0001"); 34 QString m0 = Opie::Core::OResource::findPixmap("parashoot/man0001");
36 m0.replace(QRegExp("0001"),"%1"); 35 m0.replace(QRegExp("0001"),"%1");
37 manarray->readPixmaps(m0, 7); 36 manarray->readPixmaps(m0, 7);
38 setSequence(manarray); 37 setSequence(manarray);
39 setAnimated(true); 38 setAnimated(true);
40 mancount++; 39 mancount++;
41 dead = false; 40 dead = false;
42 start(); 41 start();
43} 42}
44 43
45Man::Man(QCanvas* canvas, int x, int y) : 44Man::Man(QCanvas* canvas, int x, int y) :
46 QCanvasSprite(0, canvas), 45 QCanvasSprite(0, canvas),
47 splat("bang") // No tr 46 splat("bang") // No tr
48{ 47{
49 manarray = new QCanvasPixmapArray(); 48 manarray = new QCanvasPixmapArray();
50 QString m0 = Resource::findPixmap("parashoot/man0001"); 49 QString m0 = Opie::Core::OResource::findPixmap("parashoot/man0001");
51 m0.replace(QString("0001"),"%1"); 50 m0.replace(QString("0001"),"%1");
52 manarray->readPixmaps(m0, 7); 51 manarray->readPixmaps(m0, 7);
53 setSequence(manarray); 52 setSequence(manarray);
54 move(x, y); 53 move(x, y);
55 setFrame(5); 54 setFrame(5);
56 setZ(300); 55 setZ(300);
57 show(); 56 show();
58 57
59 static bool first_time = TRUE; 58 static bool first_time = TRUE;
60 if (first_time) { 59 if (first_time) {
61 first_time = FALSE; 60 first_time = FALSE;
62 QTime midnight(0, 0, 0); 61 QTime midnight(0, 0, 0);
63 srand(midnight.secsTo(QTime::currentTime()) ); 62 srand(midnight.secsTo(QTime::currentTime()) );
64 } 63 }
65 int yfallspeed = 0; 64 int yfallspeed = 0;
66 yfallspeed = (rand() % 3) + 1; 65 yfallspeed = (rand() % 3) + 1;
67 setVelocity(0, yfallspeed); 66 setVelocity(0, yfallspeed);
68 67
69 mancount++; 68 mancount++;
70 dead = false; 69 dead = false;
71} 70}
72int f = 0; 71int f = 0;
73 72
74void Man::advance(int phase) 73void Man::advance(int phase)