summaryrefslogtreecommitdiff
path: root/noncore/games/parashoot
Unidiff
Diffstat (limited to 'noncore/games/parashoot') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/parashoot/base.cpp5
-rw-r--r--noncore/games/parashoot/bullet.cpp5
-rw-r--r--noncore/games/parashoot/cannon.cpp5
-rw-r--r--noncore/games/parashoot/helicopter.cpp4
-rw-r--r--noncore/games/parashoot/interface.cpp10
-rw-r--r--noncore/games/parashoot/man.cpp7
6 files changed, 18 insertions, 18 deletions
diff --git a/noncore/games/parashoot/base.cpp b/noncore/games/parashoot/base.cpp
index 5f3c79d..f232536 100644
--- a/noncore/games/parashoot/base.cpp
+++ b/noncore/games/parashoot/base.cpp
@@ -11,36 +11,35 @@
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#include "codes.h" 20#include "codes.h"
21#include "base.h" 21#include "base.h"
22 22
23#include <qtopia/resource.h> 23#include <opie2/oresource.h>
24
25 24
26int damage; 25int damage;
27 26
28Base::Base(QCanvas* canvas) : 27Base::Base(QCanvas* canvas) :
29 QCanvasSprite(0, canvas), 28 QCanvasSprite(0, canvas),
30 kaboom("landmine"), 29 kaboom("landmine"),
31 ohdear("crmble01") 30 ohdear("crmble01")
32{ 31{
33 basearray = new QCanvasPixmapArray(); 32 basearray = new QCanvasPixmapArray();
34 QString b0 = Resource::findPixmap("parashoot/b0001"); 33 QString b0 = Opie::Core::OResource::findPixmap("parashoot/b0001");
35 b0.replace(QRegExp("0001"),"%1"); 34 b0.replace(QRegExp("0001"),"%1");
36 basearray->readPixmaps(b0, 4); 35 basearray->readPixmaps(b0, 4);
37 setSequence(basearray); 36 setSequence(basearray);
38 setFrame(0); 37 setFrame(0);
39 move(2, canvas->height()-50); 38 move(2, canvas->height()-50);
40 setZ(10); 39 setZ(10);
41 show(); 40 show();
42 damage = 0; 41 damage = 0;
43} 42}
44 43
45void Base::damageBase() 44void Base::damageBase()
46{ 45{
diff --git a/noncore/games/parashoot/bullet.cpp b/noncore/games/parashoot/bullet.cpp
index 584f564..1f02251 100644
--- a/noncore/games/parashoot/bullet.cpp
+++ b/noncore/games/parashoot/bullet.cpp
@@ -14,37 +14,38 @@
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 "bullet.h" 22#include "bullet.h"
23#include "man.h" 23#include "man.h"
24#include "helicopter.h" 24#include "helicopter.h"
25 25
26#include <qpe/resource.h> 26#include <opie2/oresource.h>
27
27#include <qpe/qmath.h> 28#include <qpe/qmath.h>
28 29
29 30
30int limit; 31int limit;
31int shotcount; 32int shotcount;
32int nobullets; 33int nobullets;
33 34
34Bullet::Bullet(QCanvas* canvas, double angle, int cannonx, int cannony) : 35Bullet::Bullet(QCanvas* canvas, double angle, int cannonx, int cannony) :
35 QCanvasSprite(0, canvas), 36 QCanvasSprite(0, canvas),
36 bang("collide01") 37 bang("collide01")
37{ 38{
38 QCanvasPixmapArray* bulletarray = new QCanvasPixmapArray(Resource::findPixmap("parashoot/bullet")); 39 QCanvasPixmapArray* bulletarray = new QCanvasPixmapArray(Opie::Core::OResource::findPixmap("parashoot/bullet"));
39 setSequence(bulletarray); 40 setSequence(bulletarray);
40 if (nobullets < limit) { 41 if (nobullets < limit) {
41 nobullets++; 42 nobullets++;
42 move(cannonx, cannony); 43 move(cannonx, cannony);
43 dy = 0; 44 dy = 0;
44 dx = 0; 45 dx = 0;
45 show(); 46 show();
46 setXY(angle); 47 setXY(angle);
47 setVelocity(-dx, -dy); 48 setVelocity(-dx, -dy);
48 bang.play(); 49 bang.play();
49 } else 50 } else
50 return; 51 return;
diff --git a/noncore/games/parashoot/cannon.cpp b/noncore/games/parashoot/cannon.cpp
index 330d850..2f4c353 100644
--- a/noncore/games/parashoot/cannon.cpp
+++ b/noncore/games/parashoot/cannon.cpp
@@ -9,39 +9,38 @@
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 <qtopia/resource.h> 21#include <opie2/oresource.h>
22
23 22
24#include "codes.h" 23#include "codes.h"
25#include "cannon.h" 24#include "cannon.h"
26 25
27Cannon::Cannon(QCanvas* canvas) : 26Cannon::Cannon(QCanvas* canvas) :
28 QCanvasSprite(0, canvas) 27 QCanvasSprite(0, canvas)
29{ 28{
30shotsfired=0; 29shotsfired=0;
31 index = 8; 30 index = 8;
32 cannonx = 0; 31 cannonx = 0;
33 cannony = 0; 32 cannony = 0;
34 cannonarray = new QCanvasPixmapArray(); 33 cannonarray = new QCanvasPixmapArray();
35 QString c0 = Resource::findPixmap("parashoot/can0001"); 34 QString c0 = Opie::Core::OResource::findPixmap("parashoot/can0001");
36 c0.replace(QRegExp("0001"),"%1"); 35 c0.replace(QRegExp("0001"),"%1");
37 cannonarray->readPixmaps(c0,17); 36 cannonarray->readPixmaps(c0,17);
38 setSequence(cannonarray); 37 setSequence(cannonarray);
39 setFrame(index); 38 setFrame(index);
40 39
41 reposition(); 40 reposition();
42 41
43 movedir = NoDir; 42 movedir = NoDir;
44 moveDelay = 0; 43 moveDelay = 0;
45 setAnimated(TRUE); 44 setAnimated(TRUE);
46 show(); 45 show();
47} 46}
diff --git a/noncore/games/parashoot/helicopter.cpp b/noncore/games/parashoot/helicopter.cpp
index 7d91cd1..42adc34 100644
--- a/noncore/games/parashoot/helicopter.cpp
+++ b/noncore/games/parashoot/helicopter.cpp
@@ -13,37 +13,37 @@
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 "helicopter.h" 21#include "helicopter.h"
22#include "man.h" 22#include "man.h"
23#include "codes.h" 23#include "codes.h"
24 24
25#include <qtopia/resource.h> 25#include <opie2/oresource.h>
26 26
27 27
28static QList<Helicopter> all; 28static QList<Helicopter> all;
29 29
30Helicopter::Helicopter(QCanvas* canvas) : 30Helicopter::Helicopter(QCanvas* canvas) :
31 QCanvasSprite(0, canvas), 31 QCanvasSprite(0, canvas),
32 chikachika("aland01") 32 chikachika("aland01")
33{ 33{
34 all.append(this); 34 all.append(this);
35 hits = 0; 35 hits = 0;
36 QCanvasPixmapArray* helicopterarray = new QCanvasPixmapArray(); 36 QCanvasPixmapArray* helicopterarray = new QCanvasPixmapArray();
37 QString h0 = Resource::findPixmap("parashoot/helicopter0001"); 37 QString h0 = Opie::Core::OResource::findPixmap("parashoot/helicopter0001");
38 h0.replace(QRegExp("0001"),"%1"); 38 h0.replace(QRegExp("0001"),"%1");
39 helicopterarray->readPixmaps(h0,4 ); 39 helicopterarray->readPixmaps(h0,4 );
40 40
41 setSequence(helicopterarray); 41 setSequence(helicopterarray);
42 setAnimated(true); 42 setAnimated(true);
43 move(canvas->width(), 5); 43 move(canvas->width(), 5);
44 setVelocity(-2, 0); 44 setVelocity(-2, 0);
45 chikachika.playLoop(); 45 chikachika.playLoop();
46 show(); 46 show();
47} 47}
48 48
49Helicopter::~Helicopter() 49Helicopter::~Helicopter()
diff --git a/noncore/games/parashoot/interface.cpp b/noncore/games/parashoot/interface.cpp
index 5c9b0ef..8ec7032 100644
--- a/noncore/games/parashoot/interface.cpp
+++ b/noncore/games/parashoot/interface.cpp
@@ -12,26 +12,27 @@
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 "interface.h" 21#include "interface.h"
22#include "man.h" 22#include "man.h"
23 23
24#include <opie2/oresource.h>
25
24#include <qtopia/qpeapplication.h> 26#include <qtopia/qpeapplication.h>
25#include <qtopia/resource.h>
26 27
27#include <qtoolbar.h> 28#include <qtoolbar.h>
28#include <qtoolbutton.h> 29#include <qtoolbutton.h>
29 30
30ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) : 31ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
31 QMainWindow(parent,name,f), 32 QMainWindow(parent,name,f),
32 canvas( 232, 258 ), 33 canvas( 232, 258 ),
33 cannon(NULL), 34 cannon(NULL),
34 base(NULL), 35 base(NULL),
35 gamestopped( true ), 36 gamestopped( true ),
36 waitover( false ), 37 waitover( false ),
37 fanfare("level_up"), 38 fanfare("level_up"),
@@ -43,26 +44,27 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
43 updatespeed = 80; 44 updatespeed = 80;
44 canvas.setAdvancePeriod(80); 45 canvas.setAdvancePeriod(80);
45 46
46 pb = new QCanvasView(&canvas, this); 47 pb = new QCanvasView(&canvas, this);
47 pb->setFocus(); 48 pb->setFocus();
48 49
49 setToolBarsMovable( FALSE ); 50 setToolBarsMovable( FALSE );
50 51
51 QToolBar* toolbar = new QToolBar(this); 52 QToolBar* toolbar = new QToolBar(this);
52 toolbar->setHorizontalStretchable( TRUE ); 53 toolbar->setHorizontalStretchable( TRUE );
53 54
54 setCaption( tr("ParaShoot") ); 55 setCaption( tr("ParaShoot") );
55 new QToolButton( Resource::loadIconSet("new"), tr("New Game"), 0, 56 QToolButton *btn = new QToolButton( Opie::Core::OResource::loadPixmap("new", Opie::Core::OResource::SmallIcon),
56 this, SLOT(newGame()), toolbar, "New Game"); 57 tr("New Game"), 0, this, SLOT(newGame()), toolbar, "New Game");
58 btn->setUsesBigPixmap( qApp->desktop()->size().width() > 330 );
57 59
58 levelscore = new QLabel(toolbar); 60 levelscore = new QLabel(toolbar);
59 levelscore->setBackgroundMode( PaletteButton ); 61 levelscore->setBackgroundMode( PaletteButton );
60 levelscore->setAlignment( AlignRight | AlignVCenter | ExpandTabs ); 62 levelscore->setAlignment( AlignRight | AlignVCenter | ExpandTabs );
61 toolbar->setStretchableWidget( levelscore ); 63 toolbar->setStretchableWidget( levelscore );
62 showScore(0,0); 64 showScore(0,0);
63 65
64 setCentralWidget(pb); 66 setCentralWidget(pb);
65 67
66 autoDropTimer = new QTimer(this); 68 autoDropTimer = new QTimer(this);
67 connect (autoDropTimer, SIGNAL(timeout()), this, SLOT(play()) ); 69 connect (autoDropTimer, SIGNAL(timeout()), this, SLOT(play()) );
68 70
@@ -70,25 +72,25 @@ ParaShoot::ParaShoot(QWidget* parent, const char* name, WFlags f) :
70 connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) ); 72 connect(pauseTimer, SIGNAL(timeout()), this, SLOT(wait()) );
71 73
72 setFocusPolicy(StrongFocus); 74 setFocusPolicy(StrongFocus);
73} 75}
74 76
75 77
76void ParaShoot::resizeEvent(QResizeEvent *) 78void ParaShoot::resizeEvent(QResizeEvent *)
77{ 79{
78 QSize s = centralWidget()->size(); 80 QSize s = centralWidget()->size();
79 int fw = style().defaultFrameWidth(); 81 int fw = style().defaultFrameWidth();
80 canvas.resize( s.width() - fw - 2, s.height() - fw - 2); 82 canvas.resize( s.width() - fw - 2, s.height() - fw - 2);
81 83
82 QImage bgimage = Resource::loadImage("parashoot/sky"); 84 QImage bgimage = Opie::Core::OResource::loadImage("parashoot/sky");
83 QPixmap bgpixmap; 85 QPixmap bgpixmap;
84 86
85 bgpixmap.convertFromImage(bgimage.smoothScale(canvas.width(), 87 bgpixmap.convertFromImage(bgimage.smoothScale(canvas.width(),
86 canvas.height()), QPixmap::Auto); 88 canvas.height()), QPixmap::Auto);
87 canvas.setBackgroundPixmap(bgpixmap); 89 canvas.setBackgroundPixmap(bgpixmap);
88 90
89 if (base) { 91 if (base) {
90 base->reposition(); 92 base->reposition();
91 } 93 }
92 94
93 if (cannon) { 95 if (cannon) {
94 cannon->reposition(); 96 cannon->reposition();
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
@@ -13,50 +13,49 @@
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);