diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | c90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch) | |
tree | 6d8391395bce9eaea4ad78958617edb20c6a7573 /kspaceduel | |
download | tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kspaceduel')
447 files changed, 4116 insertions, 0 deletions
diff --git a/kspaceduel/AUTHORS b/kspaceduel/AUTHORS new file mode 100644 index 00000000..bcb050bf --- /dev/null +++ b/kspaceduel/AUTHORS @@ -0,0 +1,2 @@ +Author of KSpaceduel: +Andreas Zehender <az@azweb.de> diff --git a/kspaceduel/ChangeLog b/kspaceduel/ChangeLog new file mode 100644 index 00000000..95bada83 --- /dev/null +++ b/kspaceduel/ChangeLog @@ -0,0 +1,11 @@ +version 1.0 + * [Andreas Zehender] Portet to Qt-2.0 + * [Andreas Zehender] Changed option dialogs + +version 0.2.2 + * [Andreas Zehender] fixed error in ExplosionSprite::setSequence + +version 0.2.1 + * [Andreas Zehender] Implemented movements, bullets, mines + * [Andreas Zehender] First released version + diff --git a/kspaceduel/Makefile.am b/kspaceduel/Makefile.am new file mode 100644 index 00000000..00bdbe76 --- /dev/null +++ b/kspaceduel/Makefile.am @@ -0,0 +1,36 @@ +INCLUDES= -I$(top_srcdir)/libkdegames $(all_includes) + +SUBDIRS = sprites pics + +# you can add here more. This one gets installed +bin_PROGRAMS = kspaceduel + +# Which sources should be compiled for kspaceduel. +kspaceduel_SOURCES = general.ui mathroutines.cpp topwidget.cpp \ + playerinfo.cpp sprites.cpp mainview.cpp dialogs.cpp ai.cpp \ + main.cpp options.kcfgc + +kspaceduel_METASOURCES = AUTO +EXTRA_DIST = kspaceduel.desktop kspaceduel.xpm mini-kspaceduel.xpm + +kspaceduel_LDFLAGS = $(all_libraries) $(KDE_RPATH) +kspaceduel_LDADD = $(LIB_KDEGAMES) +kspaceduel_DEPENDENCIES = $(LIB_KDEGAMES_DEP) + +# this option you can leave out. Just, if you use "make dist", you need it +noinst_HEADERS = mathroutines.h topwidget.h playerinfo.h \ + sprites.h dialogs.h mainview.h defines.h ai.h structs.h \ + version.h + +DISTCLEANFILES = $(kspaceduel_METASOURCES) + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kspaceduel.pot + +KDE_ICON = kspaceduel + +xdg_apps_DATA = kspaceduel.desktop +kde_kcfg_DATA = kspaceduel.kcfg + +rcdir=$(kde_datadir)/kspaceduel +rc_DATA = kspaceduelui.rc diff --git a/kspaceduel/README b/kspaceduel/README new file mode 100644 index 00000000..6b5565ff --- /dev/null +++ b/kspaceduel/README @@ -0,0 +1,10 @@ +KSpaceduel +---------- + +KSpaceduel is an arcade two-player space game for KDE. +Two ships fly around the sun and have to shoot the other ship. + +Look at the html manual for further information. + +Andreas Zehender <az@azweb.de> +31 Oct 1998 diff --git a/kspaceduel/TODO b/kspaceduel/TODO new file mode 100644 index 00000000..4e93d5ba --- /dev/null +++ b/kspaceduel/TODO @@ -0,0 +1,5 @@ +todo: +----- + +sound!!!!! + diff --git a/kspaceduel/ai.cpp b/kspaceduel/ai.cpp new file mode 100644 index 00000000..5a7bec20 --- /dev/null +++ b/kspaceduel/ai.cpp @@ -0,0 +1,680 @@ +#include <math.h> + +#include "ai.h" +#include "mathroutines.h" +#include "options.h" + +int Ai::calcFrameIncrement[Options::EnumAiDifficulty::COUNT] = {15,8,6,2}; +int Ai::calcPositionNumber[Options::EnumAiDifficulty::COUNT] = {10,15,20,60}; +int Ai::calcShotDirections[Options::EnumAiDifficulty::COUNT] = {4,7,10,12}; +int Ai::calcCollisions[Options::EnumAiDifficulty::COUNT] = {30,15,10,10}; +int Ai::calcNextShot[Options::EnumAiDifficulty::COUNT] = {300,200,90,60}; + +Ai::Ai(int pn,ShipSprite* s[2],QPtrList<BulletSprite>* b[2], + QPtrList<MineSprite>* m[2],SConfig *c) +{ + int i; + + playerNumber=pn; + opponentNumber=(pn+1)%2; + cfg=c; + + for(i=0;i<2;i++) + { + ship[i]=s[i]; + bullets[i]=b[i]; + mines[i]=m[i]; + shipsNextPositions[i]=new QMemArray<AiSprite> + ((int)(calcPositionNumber[Options::aiDifficulty(playerNumber)]/cfg->gamespeed)); + aiMines[i]=new QMemArray<AiSprite>(cfg->maxMines); + mineNumber[i]=0; + } + myShots.setAutoDelete(true); + objectsHitByShip.setAutoDelete(true); + minesHitByShot.setAutoDelete(true); +} + +void Ai::newRound() +{ + accelerateFramesNumber=0; + rotateFramesNumber=0; + shoot=false; + score=1e10; + + rotation=RNONE; + acc=false; + bullet=false; + mine=false; + + borderTime=-1; + sunTime=-1; + + calculateCollisions=(int)(calcCollisions[Options::aiDifficulty(playerNumber)] + /cfg->gamespeed); + waitShot=(int) rint( random.getDouble() * + calcNextShot[Options::aiDifficulty(playerNumber)] + /cfg->gamespeed); + + myShots.clear(); + objectsHitByShip.clear(); + minesHitByShot.clear(); +} + +void Ai::think() +{ + setSpriteFieldSize(); + + myShots.clear(); + borderTime=-1; + sunTime=-1; + score--; + if(waitShot>0) + waitShot--; + + calculateNextPositions(); + if(Options::aiDifficulty(playerNumber)!=Options::EnumAiDifficulty::Trainee) + testForHits(); + if(waitShot<=0) + { + tryShots(); + shotScores(); + } + chooseAction(); + + + if(rotateFramesNumber<=0) + { + rotation=RNONE; + if(accelerateFramesNumber<=0) + { + acc=false; + if(shoot) + { + bullet=true; + shoot=false; + } + else + bullet=false; + score=1e10; + } + else + { + acc=true; + accelerateFramesNumber--; + } + } + else + rotateFramesNumber--; + +} + + +AiSprite Ai::nextPosition(AiSprite sp,double mult) +{ + double abs_2,nx,ny,sq,eg; + if(!sp.sun) + { + abs_2=sp.x*sp.x+sp.y*sp.y; + if(abs_2<1) + abs_2=1; + sq=sqrt(abs_2); + nx=sp.x/sq; + ny=sp.y/sq; + eg=cfg->gravity*mult; + sp.dx-=eg*nx/abs_2; + sp.dy-=eg*ny/abs_2; + + sp.x+=sp.dx*mult; + sp.y+=sp.dy*mult; + + if(sp.x*sp.x+sp.y*sp.y<1600) + sp.sun=true; + else + { + //simple bounds actions + if(sp.x>sfwidth_2) + { + sp.x-=sfwidth; + sp.border=true; + } + else if(sp.x<-sfwidth_2) + { + sp.x+=sfwidth; + sp.border=true; + } + if(sp.y>sfheight_2) + { + sp.y-=sfheight; + sp.border=true; + } + else if(sp.y<-sfheight_2) + { + sp.y+=sfheight; + sp.border=true; + } + } + } + + return sp; +} + +void Ai::nextPositions(AiSprite sp,QMemArray<AiSprite> *a,int frames) +{ + int i,num; + double fmult=cfg->gamespeed*frames; + + (*a)[0]=nextPosition(sp,cfg->gamespeed); + num=a->size(); + for(i=1;i<num;i++) + (*a)[i]=nextPosition((*a)[i-1],fmult); +} + +void Ai::calculateNextPositions() +{ + unsigned int i,j; + MineSprite *ms; + + j=(int)(calcPositionNumber[Options::aiDifficulty(playerNumber)]/cfg->gamespeed); + + if(shipsNextPositions[0]->size() != j) + for(i=0;i<2;i++) + shipsNextPositions[i]->resize(j); + + for(i=0;i<2;i++) + nextPositions(ship[i]->toAiSprite(),shipsNextPositions[i], + calcFrameIncrement[Options::aiDifficulty(playerNumber)]); + + if(cfg->maxMines > aiMines[0]->size()) + for(i=0;i<2;i++) + aiMines[i]->resize(cfg->maxMines); + + for(i=0;i<2;i++) + { + j=0; + ms=mines[i]->first(); + while(ms) + { + (*(aiMines[i]))[j]=ms->toAiSprite(); + ms=mines[i]->next(); + j++; + } + mineNumber[i]=j; + } +} + +void Ai::tryShots() +{ + AiSprite shot,me; + double rot,nr,nx,ny; + int i,f,frameIncrement,frameNum; + Hit hit; + Shot *goodShot; + + me=ship[playerNumber]->toAiSprite(); + rot=ship[playerNumber]->getRotation(); + + //Each 'frameIncrement' frames a shot is tried + frameIncrement=(int)((2*M_PI/calcShotDirections[Options::aiDifficulty(playerNumber)]) + /cfg->rotationSpeed); + if(frameIncrement==0) + frameIncrement=1; + //Number of frames needed to rotate 180 degrees + frameNum=(int)(M_PI/(frameIncrement*cfg->rotationSpeed)); + + //if too much bullets are on the playfield, no shot is tried + if(bullets[playerNumber]->count() < + (cfg->maxBullets+ship[playerNumber]->getBulletPowerups())) + { + for(f=0;f<=frameNum;f++) + { + if(f!=0) + for(i=0;i<frameIncrement;i++) + me=nextPosition(me,cfg->gamespeed); + else + me=nextPosition(me,cfg->gamespeed); + + if(!ship[playerNumber]->reloadsBullet(f*frameIncrement*cfg->gamespeed)) + { + for(i=0;i<2;i++) + { + if((f==0)&&(i==1)) + continue; + if(i==0) + nr=rot+frameIncrement*f*cfg->rotationSpeed; + else + nr=rot-frameIncrement*f*cfg->rotationSpeed; + + nx=cos(nr); + ny=sin(nr); + shot.x=me.x+nx*SHOTDIST; + shot.y=me.y+ny*SHOTDIST; + shot.dx=me.dx+nx*cfg->shotSpeed; + shot.dy=me.dy+ny*cfg->shotSpeed; + shot.sun=false; + shot.border=false; + + hit=firstObject(shot,f*frameIncrement, + calcFrameIncrement[Options::aiDifficulty(playerNumber)]); + if((hit.object!=HNOTHING) && + !((hit.object==HSHIP)&&(hit.playerNumber==playerNumber))) + { + goodShot=new Shot; + goodShot->hit=hit; + goodShot->rotation=(i==0?RLEFT:RRIGHT); + goodShot->rotationFrames=f*frameIncrement; + goodShot->score=1e10; + myShots.append(goodShot); + } + } + } + } + } +} + +Hit Ai::firstObject(AiSprite shot,int time,int frames) +{ + int optime,i,num,rtime,basetime,t,m; + double dist,distx,disty,shiplastdist=0; + bool shipdistgreater=true,hitfound=false; + Hit hit={HNOTHING,0,0,0,1e10}; + + basetime=time/frames; + if((time%frames)>0) + basetime++; + rtime=basetime*frames-time; + optime=shipsNextPositions[0]->size(); + + num=optime-basetime; + + if(num>0) + { + for(t=0;(t<num)&&(!hitfound)&&(!shot.sun);t++) + { + if(t==0) + shot=nextPosition(shot,cfg->gamespeed*rtime); + else + shot=nextPosition(shot,cfg->gamespeed*frames); + + //distance to other objects + for(i=0;i<2;i++) + { + distx=(*(shipsNextPositions[i]))[basetime].x-shot.x; + disty=(*(shipsNextPositions[i]))[basetime].y-shot.y; + dist=distx*distx+disty*disty; + //own ship + if(i==playerNumber) + { + if(dist<shiplastdist) + shipdistgreater=false; + if((!shipdistgreater)&&(dist<hit.distance)) + { + hit.object=HSHIP; + hit.objectNumber=0; + hit.playerNumber=i; + hit.hitTime=basetime*frames; + hit.distance=dist; + } + shiplastdist=dist; + } + //other ship + else if(dist<hit.distance) + { + hit.object=HSHIP; + hit.objectNumber=0; + hit.playerNumber=i; + hit.hitTime=basetime*frames; + hit.distance=dist; + } + + //mines + for(m=0;m<mineNumber[i];m++) + { + distx=(*(aiMines[i]))[m].x-shot.x; + disty=(*(aiMines[i]))[m].y-shot.y; + dist=distx*distx+disty*disty; + + if(dist<hit.distance) + { + hit.object=HMINE; + hit.playerNumber=i; + hit.objectNumber=m; + hit.hitTime=basetime*frames; + hit.distance=dist; + } + } + } + if(hit.distance<100) + hitfound=true; + basetime++; + } + } + + return hit; +} + +void Ai::testForHits() +{ + AiSprite shot; + unsigned int i; + int m,p; + BulletSprite *bullet; + Hit *h; + Hit hit; + bool hitfound=false; + double distance,dx,dy; + + if(calculateCollisions>0) + { + calculateCollisions--; + h=objectsHitByShip.first(); + while(h) + { + if(h->hitTime>0) + { + h->hitTime--; + h=objectsHitByShip.next(); + } + else + { + objectsHitByShip.remove(); + h=objectsHitByShip.current(); + } + } + h=minesHitByShot.first(); + while(h) + { + if(h->hitTime>0) + { + h->hitTime--; + h=minesHitByShot.next(); + } + else + { + minesHitByShot.remove(); + h=minesHitByShot.current(); + } + } + } + else + { + objectsHitByShip.clear(); + minesHitByShot.clear(); + for(i=0;i<2;i++) + { + for(bullet=bullets[i]->first();bullet;bullet=bullets[i]->next()) + { + shot=bullet->toAiSprite(); + hit=firstObject(shot,0,calcFrameIncrement[Options::aiDifficulty(playerNumber)]); + if(hit.object==HMINE) + { + h=new Hit(hit); + minesHitByShot.append(h); + } + if((hit.object==HSHIP)&&(hit.playerNumber==playerNumber)) + { + h=new Hit(hit); + h->object=HSHOT; + objectsHitByShip.append(h); + } + } + } + + hit.object=HNOTHING; + hit.distance=400; + + for(i=0;(i<shipsNextPositions[0]->size()) && + !(*shipsNextPositions[playerNumber])[i].sun;i++) + { + if((borderTime<0) && (*shipsNextPositions[playerNumber])[i].border) + borderTime=i*calcFrameIncrement[Options::aiDifficulty(playerNumber)]; + + dx=(*shipsNextPositions[playerNumber])[i].x; + dy=(*shipsNextPositions[playerNumber])[i].y; + distance=dx*dx+dy*dy; + if((distance<3025)&&(sunTime<0)) + sunTime=i*calcFrameIncrement[Options::aiDifficulty(playerNumber)]; + + if(!hitfound) + for(p=0;p<2;p++) + for(m=0;m<mineNumber[p];m++) + { + dx=(*shipsNextPositions[playerNumber])[i].x-(*aiMines[p])[m].x; + dy=(*shipsNextPositions[playerNumber])[i].y-(*aiMines[p])[m].y; + distance=dx*dx+dy*dy; + if(hit.distance>distance) + { + hit.object=HMINE; + hit.playerNumber=p; + hit.objectNumber=m; + hit.hitTime=i*calcFrameIncrement[Options::aiDifficulty(playerNumber)]; + hit.distance=distance; + if(distance<100) + hitfound=true; + } + } + } + if(hit.object!=HNOTHING) + { + h=new Hit(hit); + objectsHitByShip.append(h); + } + calculateCollisions=(int)(calcCollisions[Options::aiDifficulty(playerNumber)]/cfg->gamespeed); + } +} + +void Ai::shotScores() +{ + Shot *s; + Hit *h,*mh; + bool found,foundmh; + double dist,dx,dy,fuel; + + + dx=(*shipsNextPositions[playerNumber])[0].x-(*shipsNextPositions[opponentNumber])[0].x; + dy=(*shipsNextPositions[playerNumber])[0].y-(*shipsNextPositions[opponentNumber])[0].y; + dist=dx*dx+dy*dy; + + for(s=myShots.first();s;s=myShots.next()) + { + fuel=(100-(ship[playerNumber]->getEnergy()-cfg->shotEnergyNeed)); + s->score=fuel*fuel/10 + s->hit.distance+s->hit.hitTime; + if(dist > (75*75)) + s->score+=waitShot*8; + else + s->score+=waitShot*4; + + if(s->hit.object==HMINE) + { + found=false; + for(h=objectsHitByShip.first();h && !found;h=objectsHitByShip.next()) + { + if((h->object==HMINE)&&(h->playerNumber==s->hit.playerNumber) + &&(h->objectNumber==s->hit.objectNumber)) + //ship will hit a mine that will be hitten by the shot + { + found=true; + //ship hits earlier then shot + if(h->hitTime<s->hit.hitTime) + s->score+=1000; + else + { + foundmh=false; + for(mh=minesHitByShot.first();mh && !foundmh;mh=minesHitByShot.next()) + { + if((mh->playerNumber==s->hit.playerNumber) + &&(mh->objectNumber==s->hit.objectNumber)) + //another shot will hit the mine + { + if(mh->hitTime<s->hit.hitTime) + s->score+=500; + else + s->score-=300; + } + } + } + } + } + if(!found) + s->score+=1000; + } + } +} + +void Ai::chooseAction() +{ + double bestScore=1e10; + Shot *bestShot=NULL,*s; + AiSprite actualpos; + double posangle,movephi,phiright,phileft,torotate=0,velangle; + int framesleft,framesright; + bool rotateAndAccelerate=false; + Hit *nextHit=0; + int shotHitTime; + + + shotHitTime=1000000; + nextHit=0; +/* for(h=objectsHitByShip.first();h;h=objectsHitByShip.next()) + if(h->object==HSHOT) + if(h->hitTime<shotHitTime) + { + nextHit=h; + shotHitTime=h->hitTime; + }*/ + + if((borderTime>0) || (sunTime>0) || (nextHit)) + { + actualpos=ship[playerNumber]->toAiSprite(); + posangle=rectToAngle(actualpos.x,actualpos.y); + + movephi=rectToAngle((*shipsNextPositions[playerNumber])[0].x, + (*shipsNextPositions[playerNumber])[0].y) - posangle; + + phileft=movephi+cfg->rotationSpeed; + phiright=movephi-cfg->rotationSpeed; + + if((borderTime>0)&& !((sunTime>0)&&(sunTime<borderTime))) + { + bestScore=borderTime/cfg->gamespeed; + if(score>bestScore) + { + velangle=rectToAngle(actualpos.dx,actualpos.dy); + if(fabs(difference(posangle+3*M_PI/4,velangle)) + < fabs(difference(posangle-3*M_PI/4,velangle))) + torotate=posangle-3*M_PI/4-ship[playerNumber]->getRotation(); + else + torotate=posangle+3*M_PI/4-ship[playerNumber]->getRotation(); + rotateAndAccelerate=true; + score=bestScore; + accelerateFramesNumber=(int)(8/cfg->gamespeed); + } + } + else if(sunTime>0) + { + bestScore=sunTime/(cfg->gamespeed*10) + +(actualpos.x*actualpos.x+actualpos.y*actualpos.y)/5000; + if(score>bestScore) + { + velangle=rectToAngle(actualpos.dx,actualpos.dy); + if(fabs(difference(posangle+2*M_PI/5,velangle)) + < fabs(difference(posangle-2*M_PI/5,velangle))) + torotate=posangle+2*M_PI/5-ship[playerNumber]->getRotation(); + else + torotate=posangle-2*M_PI/5-ship[playerNumber]->getRotation(); + rotateAndAccelerate=true; + score=bestScore; + accelerateFramesNumber=(int)(8/cfg->gamespeed); + } + } + else + { +/* bestScore=abs(nextHit->hitTime-90)*4/cfg->gamespeed + nextHit->distance*2 + + (100-(ship[playerNumber]->getEnergy()-cfg->shotEnergyNeed))*4; + if((score>bestScore)&&(bestScore<400)) + { + velangle=rectToAngle(actualpos.dx,actualpos.dy); + if(fabs(difference(posangle+2*M_PI/5,velangle)) + < fabs(difference(posangle-2*M_PI/5,velangle))) + torotate=posangle+2*M_PI/5-ship[playerNumber]->getRotation(); + else + torotate=posangle-2*M_PI/5-ship[playerNumber]->getRotation(); + rotateAndAccelerate=true; + score=bestScore; + accelerateFramesNumber=(int)(4/cfg->gamespeed); + }*/ + } + + if(rotateAndAccelerate) + { + if(phileft<0) + framesleft=1000; + else + { + while(torotate<0) + torotate+=2*M_PI; + while(torotate>=2*M_PI) + torotate-=2*M_PI; + framesleft=(int)(torotate/phileft+0.5); + } + + if(phiright>0) + framesright=1000; + else + { + while(torotate>0) + torotate-=2*M_PI; + while(torotate<=-2*M_PI) + torotate+=2*M_PI; + framesright=(int)(torotate/phiright+0.5); + } + + if(framesright<framesleft) + { + rotation=RRIGHT; + rotateFramesNumber=framesright; + } + else + { + rotation=RLEFT; + rotateFramesNumber=framesleft; + } + shoot=false; + + } + } + else + { + + bestShot=0; + for(s=myShots.first();s;s=myShots.next()) + if(s->score<bestScore) + { + bestScore=s->score; + bestShot=s; + } + if(bestShot) + { + if((bestScore<score)&&(bestScore<400)) + { + rotation=bestShot->rotation; + rotateFramesNumber=bestShot->rotationFrames; + accelerateFramesNumber=0; + shoot=true; + score=bestScore; + calculateCollisions = 0; + waitShot=(int) rint( random.getDouble() * + calcNextShot[Options::aiDifficulty(playerNumber)] + /cfg->gamespeed); + } + } + } +} + +void Ai::setSpriteFieldSize() +{ + sfwidth=(double)(ship[playerNumber]->spriteFieldWidth()); + sfheight=(double)(ship[playerNumber]->spriteFieldHeight()); + sfwidth_2=sfwidth/2.0; + sfheight_2=sfheight/2.0; +} + diff --git a/kspaceduel/ai.h b/kspaceduel/ai.h new file mode 100644 index 00000000..0369ea02 --- /dev/null +++ b/kspaceduel/ai.h @@ -0,0 +1,102 @@ +#ifndef __KSD_AI_H +#define __KSD_AI_H + +#include <krandomsequence.h> + +#include <qptrlist.h> +#include <qmemarray.h> + +#include "sprites.h" +#include "dialogs.h" +#include "options.h" + +enum Rotation {RLEFT,RNONE,RRIGHT}; + +struct MineHit +{ + int mineNumber,hitTime; + double distance; +}; + +enum HitObject {HSHIP,HMINE,HSHOT,HNOTHING}; + +struct Hit +{ + HitObject object; + int playerNumber,objectNumber,hitTime; + double distance; //distance^2 +}; + +struct Shot +{ + Hit hit; + Rotation rotation; + int rotationFrames; + double score; +}; + + +class Ai +{ +public: + Ai(int pn,ShipSprite* s[2],QPtrList<BulletSprite> *b[2], + QPtrList<MineSprite> *m[2],SConfig *c); + void newRound(); + void think(); + bool rotateLeft(){return rotation==RLEFT;} + bool rotateRight(){return rotation==RRIGHT;} + bool accelerate(){return acc;} + bool shootBullet(){return bullet;} + bool layMine(){return mine;} +private: + AiSprite nextPosition(AiSprite sp,double mult); + void nextPositions(AiSprite sp,QMemArray<AiSprite> *a,int frames); + Hit firstObject(AiSprite shot,int shotframes,int frames); + void shotScores(); + void calculateNextPositions(); + void setSpriteFieldSize(); + void testForHits(); + void tryShots(); + void chooseAction(); + + SConfig *cfg; + + KRandomSequence random; + + //actions + Rotation rotation; + bool acc; + bool bullet,mine; + //what to do when + int rotateFramesNumber,accelerateFramesNumber; + bool shoot; + double score; + //sprites + int playerNumber,opponentNumber; + ShipSprite *ship[2]; + QPtrList<BulletSprite> *bullets[2]; + QPtrList<MineSprite> *mines[2]; + QMemArray<AiSprite> *shipsNextPositions[2]; + QMemArray<AiSprite> *aiMines[2]; + int mineNumber[2]; + //possible Hits + QPtrList<Shot> myShots; + QPtrList<Hit> objectsHitByShip; + QPtrList<Hit> minesHitByShot; + int borderTime; + int sunTime; + //SpriteField width and height + double sfwidth,sfheight,sfwidth_2,sfheight_2; + //Difficulty + static int calcFrameIncrement[Options::EnumAiDifficulty::COUNT]; + static int calcPositionNumber[Options::EnumAiDifficulty::COUNT]; + static int calcShotDirections[Options::EnumAiDifficulty::COUNT]; + static int calcCollisions[Options::EnumAiDifficulty::COUNT]; + static int calcNextShot[Options::EnumAiDifficulty::COUNT]; + static double calcShotRandom[Options::EnumAiDifficulty::COUNT]; + + int calculateCollisions; + int waitShot; +}; + +#endif diff --git a/kspaceduel/configure.in.in b/kspaceduel/configure.in.in new file mode 100644 index 00000000..cd18ea8d --- /dev/null +++ b/kspaceduel/configure.in.in @@ -0,0 +1 @@ +dnl KDE_CHECK_QWSPRITEFIELD(DO_NOT_COMPILE="$DO_NOT_COMPILE kspaceduel") diff --git a/kspaceduel/defines.h b/kspaceduel/defines.h new file mode 100644 index 00000000..81162d77 --- /dev/null +++ b/kspaceduel/defines.h @@ -0,0 +1,66 @@ +#include <qnamespace.h> + + +#define IDS_PAUSE 1 +#define IDS_MAIN 2 + +#define PlayerKeyLeft 0 +#define PlayerKeyRight 1 +#define PlayerKeyAcc 2 +#define PlayerKeyShot 3 +#define PlayerKeyMine 4 +#define PlayerKeyNum 5 + +#define ROTNUM 64 + +#define MV_BACKGROUND "sprites/backgr.png" + +#define MV_SHIP1_PPM "sprites/ship1/ship%02d.ppm" +#define MV_SHIP1_PBM "sprites/ship1/ship%02d.pbm" +#define MV_SHIP2_PPM "sprites/ship2/ship%02d.ppm" +#define MV_SHIP2_PBM "sprites/ship2/ship%02d.pbm" + +#define MV_BULLET1_PPM "sprites/ship1/bullet.ppm" +#define MV_BULLET1_PBM "sprites/ship1/bullet.pbm" +#define MV_BULLET2_PPM "sprites/ship2/bullet.ppm" +#define MV_BULLET2_PBM "sprites/ship2/bullet.pbm" + +#define MV_MINE1_PPM "sprites/ship1/mine%d.ppm" +#define MV_MINE1_PBM "sprites/ship1/mine%d.pbm" +#define MV_MINE2_PPM "sprites/ship2/mine%d.ppm" +#define MV_MINE2_PBM "sprites/ship2/mine%d.pbm" + +#define MV_SUN_PPM "sprites/sun/sun.ppm" +#define MV_SUN_PBM "sprites/sun/sun.pbm" + +#define MV_EXPLOSION_PPM "sprites/explosion/explos%02d.ppm" +#define MV_EXPLOSION_PBM "sprites/explosion/explos%02d.pbm" +#define MV_MINEEX_PPM "sprites/explosion/mineex%02d.ppm" +#define MV_MINEEX_PBM "sprites/explosion/mineex%02d.pbm" + +#define MV_POWERBULLET_PPM "sprites/powerups/pbullet.ppm" +#define MV_POWERBULLET_PBM "sprites/powerups/pbullet.pbm" +#define MV_POWERMINE_PPM "sprites/powerups/pmine.ppm" +#define MV_POWERMINE_PBM "sprites/powerups/pmine.pbm" +#define MV_POWERSHIELD_PPM "sprites/powerups/pshield.ppm" +#define MV_POWERSHIELD_PBM "sprites/powerups/pshield.pbm" +#define MV_POWERENERGY_PPM "sprites/powerups/penergy.ppm" +#define MV_POWERENERGY_PBM "sprites/powerups/penergy.pbm" + +#define DEF_WIDTH 640 +#define DEF_HEIGHT 480 + +#define EXPLOSION_TIME 7 + +#define S_BASE 1500 +#define S_SUN S_BASE+0 +#define S_SHIP S_BASE+1 +#define S_BULLET S_BASE+2 +#define S_MINE S_BASE+3 +#define S_EXPLOSION S_BASE+4 +#define S_POWERUP S_BASE+5 + +#define SHOTDIST 14 +#define EPSILON 0.1 + +#define GAME_START_SHORTCUT Qt::Key_Space diff --git a/kspaceduel/dialogs.cpp b/kspaceduel/dialogs.cpp new file mode 100644 index 00000000..9e5b4b7a --- /dev/null +++ b/kspaceduel/dialogs.cpp @@ -0,0 +1,434 @@ +#include <qlabel.h> +#include <qcombobox.h> +#include <qtabwidget.h> +#include <qslider.h> +#include <qlcdnumber.h> +#include <qlayout.h> + +#include <klocale.h> + +#include "options.h" +#include "dialogs.h" +#include "general.h" + +bool operator!=(const SConfig &s1, const SConfig &s2) +{ + return +(s1.gamespeed != s2.gamespeed) || +(s1.gravity != s2.gravity) || +(s1.acc != s2.acc) || +(s1.energyNeed != s2.energyNeed) || +(s1.sunEnergy != s2.sunEnergy) || +(s1.rotationSpeed != s2.rotationSpeed) || +(s1.mineActivateTime != s2.mineActivateTime) || +(s1.mineFuel != s2.mineFuel) || +(s1.shotSpeed != s2.shotSpeed) || +(s1.shotEnergyNeed != s2.shotEnergyNeed) || +(s1.mineEnergyNeed != s2.mineEnergyNeed) || +(s1.rotationEnergyNeed != s2.rotationEnergyNeed) || +(s1.startPosX != s2.startPosX) || +(s1.startPosY != s2.startPosY) || +(s1.startVelX != s2.startVelX) || +(s1.startVelY != s2.startVelY) || +(s1.bulletLifeTime != s2.bulletLifeTime) || +(s1.mineReloadTime != s2.mineReloadTime) || +(s1.bulletReloadTime != s2.bulletReloadTime) || +(s1.bulletDamage != s2.bulletDamage) || +(s1.shipDamage != s2.shipDamage) || +(s1.mineDamage != s2.mineDamage) || +(s1.maxBullets != s2.maxBullets) || +(s1.maxMines != s2.maxMines) || +(s1.powerupLifeTime != s2.powerupLifeTime) || +(s1.powerupRefreshTime != s2.powerupRefreshTime) || +(s1.powerupEnergyAmount != s2.powerupEnergyAmount) || +(s1.powerupShieldAmount != s2.powerupShieldAmount); +} + + +char ConfigSetup::LabelName[EditNum][25]= +{ + I18N_NOOP("Game speed:"), I18N_NOOP("Shot speed:"), + I18N_NOOP("Energy need:"), I18N_NOOP("Max number:"), + I18N_NOOP("Damage:"), I18N_NOOP("Life time:"), + I18N_NOOP("Reload time:"), I18N_NOOP("Mine fuel:"), + I18N_NOOP("Energy need:"), I18N_NOOP("Activate time:"), + I18N_NOOP("Damage:"), I18N_NOOP("Max number:"), + I18N_NOOP("Reload time:"), I18N_NOOP("Acceleration:"), + I18N_NOOP("Energy need:"), I18N_NOOP("Rotation speed:"), + I18N_NOOP("Energy need:"), I18N_NOOP("Crash damage:"), + I18N_NOOP("Sun energy:"), I18N_NOOP("Gravity:"), + I18N_NOOP("Position X:"), I18N_NOOP("Position Y:"), + I18N_NOOP("Velocity X:"), I18N_NOOP("Velocity Y:"), + I18N_NOOP("Appearance time:"),I18N_NOOP("Life time:"), + I18N_NOOP("Energy amount:"), I18N_NOOP("Shield amount:") +}; + +enum ConfigSetup::Type ConfigSetup::VarType[EditNum]= +{VarFloat, + VarFloat,VarFloat,VarInt,VarInt,VarFloat,VarFloat, + VarFloat,VarFloat,VarFloat,VarInt,VarInt,VarFloat, + VarFloat,VarFloat,VarFloat, + VarFloat,VarInt, + VarFloat,VarFloat, + VarFloat,VarFloat,VarFloat,VarFloat, + VarFloat,VarFloat,VarFloat,VarInt}; + +double ConfigSetup::EditVal[EditNum][3]= +{{0.2,4.0,1}, + {0.1,10,3},{0,99,10},{0,10,5},{1,100,20},{50,2000,100},{0,400,10}, + {5,200,65},{0,99,5},{5,100,15},{1,100,30},{0,10,3},{0,400,10}, + {0,1.0,0.2},{0,10,1.0},{0.1,4,1}, + {0,10,0.2},{0,100,50}, + {1000,30000,9000},{0,10000,2200}, + {-250,250,-130},{-180,180,-100},{-10,10,3},{-10,10,-1.7}, + {200,4000,800},{200,4000,400},{0,99,50},{0,99,30}}; + +int ConfigSetup::EditDiv[EditNum]= +{100, + 10,1,1,1,1,10, + 1,1,10,1,1,10, + 100,10,10, + 10,1, + 1,1, + 10,10,100,100, + 1,1,1,1}; + +int ConfigSetup::Parent[EditNum]= +{TabGeneral, + TabBullet,TabBullet,TabBullet,TabBullet,TabBullet,TabBullet, + TabMine,TabMine,TabMine,TabMine,TabMine,TabMine, + TabShip,TabShip,TabShip,TabShip,TabShip, + TabSun,TabSun, + TabStart,TabStart,TabStart,TabStart, + TabPowerups,TabPowerups,TabPowerups,TabPowerups}; + +int ConfigSetup::Position[EditNum]= +{0, + 0,1,2,3,4,5, + 0,1,2,3,4,5, + 0,1,2,3,4, + 0,1, + 0,1,2,3, + 0,1,2,3}; + +const int LCDLen=6; + +ConfigSetup::ConfigSetup(SConfig *custom,QWidget *parent,const char *name) + :QWidget( parent, name ) +{ + QLabel *label[EditNum]; + QGridLayout *stacklayout[TabNum]; + QWidget *configWidgets[TabNum]; + //QGroupBox *box; + + int i; + + resize(500,400); + //setCaption(i18n("Game Setup")); + //setHelp( "OptionsConfigurations" ); + + + //box=new QGroupBox(i18n("Config"),this); + //setMainWidget( box ); + QVBoxLayout *boxlayout = new QVBoxLayout( this, 6 ); + + tabs=new QTabWidget(this); + for(i=0;i<TabNum;i++) + { + configWidgets[i]=new QWidget(tabs); + stacklayout[i]=new QGridLayout(configWidgets[i],6,3,10); + } + + for(i=0;i<EditNum;i++) + { + label[i]=new QLabel(i18n(LabelName[i]),configWidgets[Parent[i]]); + slider[i]=new QSlider(EditVal[i][0]*EditDiv[i],EditVal[i][1]*EditDiv[i], + (EditVal[i][1]-EditVal[i][0])/10, + EditVal[i][2]*EditDiv[i], + QSlider::Horizontal,configWidgets[Parent[i]]); + connect(slider[i],SIGNAL(valueChanged(int)),SLOT(sliderChanged(int))); + value[i]=new QLCDNumber(LCDLen,configWidgets[Parent[i]]); + value[i]->setFrameStyle(QFrame::NoFrame); + } + + configCombo=new QComboBox(false,this); + connect(configCombo,SIGNAL(activated(int)),SLOT(configSelected(int))); + for(i=0;i<predefinedConfigNum;i++) + configCombo->insertItem(i18n(predefinedConfigName[i])); + configCombo->insertItem(i18n("Custom")); + + boxlayout->addSpacing( 2 * 6 ); + boxlayout->addWidget(configCombo); + boxlayout->addWidget(tabs); + + for(i=0;i<EditNum;i++) + { + stacklayout[Parent[i]]->addWidget(label[i],Position[i],0); + stacklayout[Parent[i]]->addWidget(slider[i],Position[i],1); + stacklayout[Parent[i]]->addWidget(value[i],Position[i],2); + } + + for(i=0;i<TabNum;i++) + stacklayout[i]->activate(); + + tabs->addTab(configWidgets[0],i18n("General")); + tabs->addTab(configWidgets[1],i18n("Bullet")); + tabs->addTab(configWidgets[2],i18n("Name","Mine")); + tabs->addTab(configWidgets[3],i18n("Ship")); + tabs->addTab(configWidgets[4],i18n("Sun")); + tabs->addTab(configWidgets[5],i18n("Start")); + tabs->addTab(configWidgets[6],i18n("Powerups")); + + customConfig=custom; + + updateWidgets(); +} + +void ConfigSetup::updateWidgets() +{ + config=*customConfig; + selectedConfig = -1; + configCombo->setCurrentItem(Options::lastConfig()); + configSelected(Options::lastConfig()); +} + +void ConfigSetup::valueChanged(int ednum,int value) +{ + if(selectedConfig==predefinedConfigNum) + { + switch(ednum) + { + case EditMaxBullets:config.maxBullets=value;break; + case EditBulletDamage:config.bulletDamage=value;break; + case EditMaxMines:config.maxMines=value;break; + case EditMineDamage:config.mineDamage=value;break; + case EditShipDamage:config.shipDamage=value;break; + case EditPowerupShieldAmount:config.powerupShieldAmount=value;break; + } + emit changed(); + } +} + +void ConfigSetup::valueChanged(int ednum,double value) +{ + if(selectedConfig==predefinedConfigNum) + { + switch(ednum) + { + case EditSunEnergy:config.sunEnergy=value;break; + case EditGravity:config.gravity=value;break; + case EditShotSpeed:config.shotSpeed=value;break; + case EditShotEnergyNeed:config.shotEnergyNeed=value;break; + case EditBulletLifeTime:config.bulletLifeTime=value;break; + case EditBulletReloadTime:config.bulletReloadTime=value;break; + case EditMineFuel:config.mineFuel=value;break; + case EditMineEnergyNeed:config.mineEnergyNeed=value;break; + case EditMineActivateTime:config.mineActivateTime=value;break; + case EditMineReloadTime:config.mineReloadTime=value;break; + case EditGamespeed:config.gamespeed=value;break; + case EditPosX:config.startPosX=value;break; + case EditPosY:config.startPosY=value;break; + case EditVelX:config.startVelX=value;break; + case EditVelY:config.startVelY=value;break; + case EditAcc:config.acc=value;break; + case EditEnergyNeed:config.energyNeed=value;break; + case EditRotationSpeed:config.rotationSpeed=value;break; + case EditRotationEnergyNeed:config.rotationEnergyNeed=value;break; + case EditPowerupRefreshTime:config.powerupRefreshTime=value;break; + case EditPowerupLifeTime:config.powerupLifeTime=value;break; + case EditPowerupEnergyAmount:config.powerupEnergyAmount=value;break; + } + emit changed(); + } +} + +void ConfigSetup::updateSettings() +{ + *customConfig=config; + + Options::setLastConfig(selectedConfig); + Options::writeConfig(); +} + +bool ConfigSetup::hasChanged() +{ + if (configCombo->currentItem() != Options::lastConfig()) + return true; + + if (configCombo->currentItem() != predefinedConfigNum) + return false; + + return ((*customConfig) != config); +} + +void ConfigSetup::updateWidgetsDefault() +{ + configCombo->setCurrentItem(0); + configSelected(0); +} + +bool ConfigSetup::isDefault() +{ + return configCombo->currentItem() == 0; +} + +void ConfigSetup::configSelected(int num) +{ + int i; + if(!((selectedConfig==predefinedConfigNum)&&(num==predefinedConfigNum))) + { + selectedConfig = num; + for(i=0;i<EditNum;i++) + slider[i]->setEnabled(num==predefinedConfigNum); + //enableButton( Default, num==predefinedConfigNum ); + if(num<predefinedConfigNum) + displayConfig(predefinedConfig[num]); + else + displayConfig(config); + emit changed(); + } +} + +void ConfigSetup::displayConfig(SConfig cfg) +{ + setValue(EditSunEnergy,cfg.sunEnergy); + setValue(EditGravity,cfg.gravity); + + setValue(EditShotSpeed,cfg.shotSpeed); + setValue(EditShotEnergyNeed,cfg.shotEnergyNeed); + setValue(EditMaxBullets,cfg.maxBullets); + setValue(EditBulletDamage,cfg.bulletDamage); + setValue(EditBulletLifeTime,cfg.bulletLifeTime); + setValue(EditBulletReloadTime,cfg.bulletReloadTime); + + setValue(EditMineFuel,cfg.mineFuel); + setValue(EditMineEnergyNeed,cfg.mineEnergyNeed); + setValue(EditMineActivateTime,cfg.mineActivateTime); + setValue(EditMineDamage,cfg.mineDamage); + setValue(EditMaxMines,cfg.maxMines); + setValue(EditMineReloadTime,cfg.mineReloadTime); + + setValue(EditGamespeed,cfg.gamespeed); + + setValue(EditPosX,cfg.startPosX); + setValue(EditPosY,cfg.startPosY); + setValue(EditVelX,cfg.startVelX); + setValue(EditVelY,cfg.startVelY); + + setValue(EditAcc,cfg.acc); + setValue(EditEnergyNeed,cfg.energyNeed); + setValue(EditRotationSpeed,cfg.rotationSpeed); + setValue(EditRotationEnergyNeed,cfg.rotationEnergyNeed); + setValue(EditShipDamage,cfg.shipDamage); + + setValue(EditPowerupLifeTime,cfg.powerupLifeTime); + setValue(EditPowerupRefreshTime,cfg.powerupRefreshTime); + setValue(EditPowerupShieldAmount,cfg.powerupShieldAmount); + setValue(EditPowerupEnergyAmount,cfg.powerupEnergyAmount); +} + +void ConfigSetup::setValue(int ednum,int val) +{ + QString str; + str.sprintf("%*i",LCDLen,val); + value[ednum]->display(str); + slider[ednum]->setValue(val); +} + +void ConfigSetup::setValue(int ednum,double val) +{ + QString str; + int hval=(int)(val*EditDiv[ednum]+0.5); + int n,h; + + if(EditDiv[ednum]==1) + str.sprintf("%*i",LCDLen,hval); + else + { + h=1; + for(n=0;h<EditDiv[ednum];n++) + h*=10; + str.sprintf("%*.*f",LCDLen,n,val); + } + value[ednum]->display(str); + slider[ednum]->setValue(hval); +} + +void ConfigSetup::setValue(int ednum,unsigned val) +{ + QString str; + str.sprintf("%*i",LCDLen,(int)val); + value[ednum]->display(str); + slider[ednum]->setValue((int)val); +} + +void ConfigSetup::sliderChanged(int val) +{ + int i,n,h; + QString str; + + for(i=0;(i<EditNum)&&(slider[i]!=sender());i++); + if(i<EditNum) + { + if(EditDiv[i]==1) + str.sprintf("%*i",LCDLen,val); + else + { + h=1; + for(n=0;h<EditDiv[i];n++) + h*=10; + str.sprintf("%*.*f",LCDLen,n,(double)val/EditDiv[i]); + } + value[i]->display(str); + if(VarType[i]==VarFloat) + valueChanged(i,(double)val/EditDiv[i]); + else + valueChanged(i,val); + } + +} + +SettingsDialog::SettingsDialog(SConfig *customConfig, QWidget *parent, const char *name) + : KConfigDialog( parent, name, Options::self()) +{ + General *general = new General(); + addPage(general, i18n("General"), "package_settings", i18n("General Settings")); + + cs = new ConfigSetup(customConfig); + addPage(cs, i18n("Game"), "kspaceduel", i18n("Game Settings")); + connect(cs, SIGNAL(changed()), this, SLOT(updateButtons())); + +// resize(600,400); +} + +SettingsDialog::~SettingsDialog() +{ +} + +void SettingsDialog::updateWidgetsDefault() +{ + cs->updateWidgetsDefault(); +} + +void SettingsDialog::updateWidgets() +{ + cs->updateWidgets(); +} + +void SettingsDialog::updateSettings() +{ + cs->updateSettings(); + emit settingsUpdated(); +} + +bool SettingsDialog::hasChanged() +{ + return cs->hasChanged(); +} + +bool SettingsDialog::isDefault() +{ + return cs->isDefault(); +} + +#include "dialogs.moc" diff --git a/kspaceduel/dialogs.h b/kspaceduel/dialogs.h new file mode 100644 index 00000000..1a1ef6d2 --- /dev/null +++ b/kspaceduel/dialogs.h @@ -0,0 +1,102 @@ +#ifndef __SP_DIALOG_H +#define __SP_DIALOG_H + +class QPushButton; +class QLabel; +class QComboBox; +class QTabWidget; +class QSlider; +class QLCDNumber; +class QCheckBox; + +#include <kconfigdialog.h> + +#include "defines.h" +#include "structs.h" + + +class ConfigSetup:public QWidget +{ + Q_OBJECT +public: + ConfigSetup(SConfig *custom,QWidget *parent=0,const char* name=0); + + bool hasChanged(); + bool isDefault(); + void updateSettings(); + void updateWidgets(); + void updateWidgetsDefault(); + +signals: + void changed(); + +protected slots: + void configSelected(int num); + void sliderChanged(int val); +protected: + void valueChanged(int ednum,int val); + void valueChanged(int ednum,double val); + void displayConfig(SConfig cfg); + void setValue(int ednum,int val); + void setValue(int ednum,double val); + void setValue(int ednum,unsigned val); +private: + enum {EditGamespeed=0, + EditShotSpeed,EditShotEnergyNeed,EditMaxBullets,EditBulletDamage, + EditBulletLifeTime,EditBulletReloadTime, + EditMineFuel,EditMineEnergyNeed,EditMineActivateTime, + EditMineDamage,EditMaxMines,EditMineReloadTime, + EditAcc,EditEnergyNeed,EditRotationSpeed, + EditRotationEnergyNeed,EditShipDamage, + EditSunEnergy,EditGravity, + EditPosX,EditPosY,EditVelX,EditVelY, + EditPowerupRefreshTime,EditPowerupLifeTime, + EditPowerupEnergyAmount,EditPowerupShieldAmount, + EditNum}; + enum {TabGeneral=0,TabBullet,TabMine, + TabShip,TabSun,TabStart,TabPowerups,TabNum}; + enum Type {VarInt,VarFloat}; + + static char LabelName[EditNum][25]; + static int Parent[EditNum]; + static int Position[EditNum]; + static const char *TabName[TabNum]; + static double EditVal[EditNum][3]; + static int EditDiv[EditNum]; + static Type VarType[EditNum]; + + QTabWidget *tabs; + + QSlider *slider[EditNum]; + QLCDNumber *value[EditNum]; + + QComboBox *configCombo; + SConfig *customConfig,config; + + int selectedConfig; +}; + +class SettingsDialog : public KConfigDialog +{ + Q_OBJECT +public: + SettingsDialog(SConfig *customConfig, QWidget *parent=0, const char *name=0); + ~SettingsDialog(); + +signals: + void settingsUpdated(); + +private slots: + void updateWidgets(); + void updateWidgetsDefault(); + void updateSettings(); + +private: + bool hasChanged(); + bool isDefault(); + +private: + ConfigSetup* cs; +}; + +#endif diff --git a/kspaceduel/general.ui b/kspaceduel/general.ui new file mode 100644 index 00000000..83f3108f --- /dev/null +++ b/kspaceduel/general.ui @@ -0,0 +1,337 @@ +<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> +<class>General</class> +<widget class="QWidget"> + <property name="name"> + <cstring>General</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>512</width> + <height>488</height> + </rect> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>groupBox3</cstring> + </property> + <property name="frameShape"> + <enum>GroupBoxPanel</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="title"> + <string>Hit Points</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLCDNumber" row="1" column="2"> + <property name="name"> + <cstring>lCDNumber2</cstring> + </property> + <property name="numDigits"> + <number>2</number> + </property> + <property name="value" stdset="0"> + <number>99</number> + </property> + </widget> + <widget class="QLCDNumber" row="0" column="2"> + <property name="name"> + <cstring>lCDNumber1</cstring> + </property> + <property name="numDigits"> + <number>2</number> + </property> + <property name="value" stdset="0"> + <number>99</number> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>Red player:</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel4</cstring> + </property> + <property name="text"> + <string>Blue player:</string> + </property> + </widget> + <widget class="QSlider" row="1" column="1"> + <property name="name"> + <cstring>kcfg_StartHitPoints1</cstring> + </property> + <property name="minValue"> + <number>1</number> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + <widget class="QSlider" row="0" column="1"> + <property name="name"> + <cstring>kcfg_StartHitPoints0</cstring> + </property> + <property name="minValue"> + <number>1</number> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + </grid> + </widget> + <widget class="QGroupBox" row="1" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>groupBox4</cstring> + </property> + <property name="title"> + <string>Graphics</string> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel5</cstring> + </property> + <property name="text"> + <string>Refresh time:</string> + </property> + </widget> + <widget class="QSlider"> + <property name="name"> + <cstring>kcfg_RefreshTime</cstring> + </property> + <property name="minValue"> + <number>10</number> + </property> + <property name="maxValue"> + <number>100</number> + </property> + <property name="value"> + <number>33</number> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + <widget class="QLCDNumber"> + <property name="name"> + <cstring>lCDNumber3</cstring> + </property> + <property name="numDigits"> + <number>3</number> + </property> + <property name="value" stdset="0"> + <number>33</number> + </property> + </widget> + </hbox> + </widget> + <spacer row="3" column="1"> + <property name="name"> + <cstring>spacer4</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>91</height> + </size> + </property> + </spacer> + <widget class="QGroupBox" row="2" column="0"> + <property name="name"> + <cstring>groupBox1</cstring> + </property> + <property name="title"> + <string>Red Player</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>kcfg_Player0IsAi</cstring> + </property> + <property name="text"> + <string>Player is AI</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Difficulty:</string> + </property> + </widget> + <widget class="QComboBox" row="1" column="1"> + <item> + <property name="text"> + <string>Trainee</string> + </property> + </item> + <item> + <property name="text"> + <string>Normal</string> + </property> + </item> + <item> + <property name="text"> + <string>Hard</string> + </property> + </item> + <item> + <property name="text"> + <string>Insane</string> + </property> + </item> + <property name="name"> + <cstring>kcfg_AiDifficulty0</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="currentItem"> + <number>1</number> + </property> + </widget> + </grid> + </widget> + <widget class="QGroupBox" row="2" column="1"> + <property name="name"> + <cstring>groupBox2</cstring> + </property> + <property name="title"> + <string>Blue Player</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>kcfg_Player1IsAi</cstring> + </property> + <property name="text"> + <string>Player is AI</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Difficulty:</string> + </property> + </widget> + <widget class="QComboBox" row="1" column="1"> + <item> + <property name="text"> + <string>Trainee</string> + </property> + </item> + <item> + <property name="text"> + <string>Normal</string> + </property> + </item> + <item> + <property name="text"> + <string>Hard</string> + </property> + </item> + <item> + <property name="text"> + <string>Insane</string> + </property> + </item> + <property name="name"> + <cstring>kcfg_AiDifficulty1</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="currentItem"> + <number>1</number> + </property> + </widget> + </grid> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>kcfg_StartHitPoints0</sender> + <signal>valueChanged(int)</signal> + <receiver>lCDNumber1</receiver> + <slot>display(int)</slot> + </connection> + <connection> + <sender>kcfg_StartHitPoints1</sender> + <signal>valueChanged(int)</signal> + <receiver>lCDNumber2</receiver> + <slot>display(int)</slot> + </connection> + <connection> + <sender>kcfg_RefreshTime</sender> + <signal>valueChanged(int)</signal> + <receiver>lCDNumber3</receiver> + <slot>display(int)</slot> + </connection> + <connection> + <sender>kcfg_Player0IsAi</sender> + <signal>toggled(bool)</signal> + <receiver>textLabel1</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>kcfg_Player0IsAi</sender> + <signal>toggled(bool)</signal> + <receiver>kcfg_AiDifficulty0</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>kcfg_Player1IsAi</sender> + <signal>toggled(bool)</signal> + <receiver>textLabel2</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>kcfg_Player1IsAi</sender> + <signal>toggled(bool)</signal> + <receiver>kcfg_AiDifficulty1</receiver> + <slot>setEnabled(bool)</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kspaceduel/hi128-app-kspaceduel.png b/kspaceduel/hi128-app-kspaceduel.png Binary files differnew file mode 100644 index 00000000..623b8b0a --- /dev/null +++ b/kspaceduel/hi128-app-kspaceduel.png diff --git a/kspaceduel/hi16-app-kspaceduel.png b/kspaceduel/hi16-app-kspaceduel.png Binary files differnew file mode 100644 index 00000000..a5b4b333 --- /dev/null +++ b/kspaceduel/hi16-app-kspaceduel.png diff --git a/kspaceduel/hi22-app-kspaceduel.png b/kspaceduel/hi22-app-kspaceduel.png Binary files differnew file mode 100644 index 00000000..66037f3f --- /dev/null +++ b/kspaceduel/hi22-app-kspaceduel.png diff --git a/kspaceduel/hi32-app-kspaceduel.png b/kspaceduel/hi32-app-kspaceduel.png Binary files differnew file mode 100644 index 00000000..129dcb02 --- /dev/null +++ b/kspaceduel/hi32-app-kspaceduel.png diff --git a/kspaceduel/hi48-app-kspaceduel.png b/kspaceduel/hi48-app-kspaceduel.png Binary files differnew file mode 100644 index 00000000..c452befa --- /dev/null +++ b/kspaceduel/hi48-app-kspaceduel.png diff --git a/kspaceduel/hi64-app-kspaceduel.png b/kspaceduel/hi64-app-kspaceduel.png Binary files differnew file mode 100644 index 00000000..16d07cde --- /dev/null +++ b/kspaceduel/hi64-app-kspaceduel.png diff --git a/kspaceduel/kspaceduel.desktop b/kspaceduel/kspaceduel.desktop new file mode 100644 index 00000000..87da3326 --- /dev/null +++ b/kspaceduel/kspaceduel.desktop @@ -0,0 +1,76 @@ +[Desktop Entry] +Name=KSpaceDuel +Name[af]=K-ruimte-uitdaging +Name[ar]=لعبة مبارزة الÙضاء (KSpaceDuel) +Name[be]=КаÑÐ¼Ñ–Ñ‡Ð½Ð°Ñ Ð´ÑƒÑль +Name[bn]=কে-সà§à¦ªà§‡à¦¸à¦¡à§à§Ÿà§‡à¦² +Name[hi]=के-सà¥à¤ªà¥‡à¤¸à¤¡à¥à¤¯à¥‚à¤à¤² +Name[hr]=KSvemirski dvoboj +Name[hu]=Å°rpárbaj +Name[is]=GeimeinvÃgi +Name[nb]=Rom-duell +Name[ne]=केडीई सà¥à¤ªà¥‡à¤¸ डà¥à¤¯à¥à¤² +Name[nn]=Romduell +Name[ro]=Duel spaÅ£ial +Name[sv]=Kspaceduel +Name[ta]=Kஸà¯à®ªà¯‡à®¸à¯à®Ÿà¯à®¯à®²à¯ +Name[tg]=KМуҳорибаи Кайҳонӣ +Name[tr]=Uzay Düellosu +Name[zh_TW]=KSpaceDuel 決戰星空 +Name[zu]=I-KSpaceDuel +MimeType= +Exec=kspaceduel %i %m -caption "%c" +GenericName=Space Arcade Game +GenericName[be]=КаÑÐ¼Ñ–Ñ‡Ð½Ð°Ñ Ð°Ñ€ÐºÐ°Ð´Ð½Ð°Ñ Ð³ÑƒÐ»ÑŒÐ½Ñ +GenericName[bg]=КоÑмичеÑка игра +GenericName[bn]=মহাশূনà§à¦¯ নিয়ে à¦à¦•à¦Ÿà¦¿ আরà§à¦•à§‡à¦¡ (Arcade) খেলা +GenericName[bs]=Svemirska arkadna igra +GenericName[ca]=Joc arcade d'espai +GenericName[cs]=VesmÃrná arkádová hra +GenericName[cy]=Gêm Arcêd Ofod +GenericName[da]=Rum arkadespil +GenericName[de]=Weltraum Arkade-Spiel +GenericName[el]=Διαστημικό Arcade παιχνίδι +GenericName[eo]=Kosma arkadoludo +GenericName[es]=Juego recreativo espacial +GenericName[et]=Põnevusmäng kosmoses +GenericName[eu]=Espazioko arcade jokoa +GenericName[fa]=بازی گذرگاه Ùضایی +GenericName[fi]=Arcade-peli +GenericName[fr]=Jeu d'arcade dans l'espace +GenericName[he]=משחק ×רקייד חללי +GenericName[hr]=Arkadna igra u Svemiru +GenericName[hu]=LövöldözÅ‘s +GenericName[is]=Skotgeimleikur +GenericName[it]=Gioco arcade nello spazio +GenericName[ja]=宇宙アーケードゲーム+GenericName[km]=ល្បែង​ទូ​លំហ+GenericName[ko]=우주 ì•„ì¼€ì´ë“œ 게임 +GenericName[lv]=KosmiskÄ dueļa spÄ“le +GenericName[mk]=Ð’ÑеленÑка аркадна игра +GenericName[nb]=Arkade-romspill +GenericName[nds]=Speelhall-Weltruumspeel +GenericName[ne]=सà¥à¤ªà¥‡à¤¸ आरà¥à¤•à¥‡à¤¡ खेल +GenericName[nl]=Ruimte-arcadespel +GenericName[nn]=Arkade-romspel +GenericName[pl]=Kosmiczna gra zrÄ™cznoÅ›ciowa +GenericName[pt]=Jogo de Arcada Espacial +GenericName[pt_BR]=Jogo de Arcade espacial +GenericName[ru]=КоÑмичеÑÐºÐ°Ñ Ð´ÑƒÑль +GenericName[sk]=VesmÃrna dobrodružná hra +GenericName[sl]=Vesoljska arkadna igra +GenericName[sr]=СвемирÑка аркадна игра +GenericName[sr@Latn]=Svemirska arkadna igra +GenericName[sv]=Rymdarkadspel +GenericName[ta]=விணà¯à®µà¯†à®³à®¿ ஆரà¯à®•à¯‡à®Ÿà¯ விளையாடà¯à®Ÿà¯ +GenericName[uk]=КоÑмічна аркадна гра - дуель +GenericName[wa]=Djeu d' Ã¥rcÃ¥de di l' espÃ¥ce +GenericName[zh_TW]=大型éŠæˆ²æ©ŸéŠæˆ² +Icon=kspaceduel +Path= +DocPath=kspaceduel/index.html +Type=Application +Terminal=false +X-KDE-StartupNotify=true +X-DCOP-ServiceType=Multi +Categories=Qt;KDE;Game;ArcadeGame; diff --git a/kspaceduel/kspaceduel.kcfg b/kspaceduel/kspaceduel.kcfg new file mode 100644 index 00000000..56b9fddd --- /dev/null +++ b/kspaceduel/kspaceduel.kcfg @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 + http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > + <kcfgfile name="kspaceduelrc"/> + <group name="Game"> + <entry name="TimeAfterKill" type="Double" key="timeAfterKill"> + <default>42.9</default> + </entry> + <entry name="StartHitPoints$(Player)" type="Int" key="startHitPointsP$(Player)"> + <parameter name="Player" type="Int" min="0" max="1"/> + <default>99</default> + <min>1</min> + <max>99</max> + </entry> + <entry name="Player$(Player)IsAi" type="Bool" key="player$(Player)IsAi"> + <parameter name="Player" type="Int" min="0" max="1"/> + <default param="0">false</default> + <default param="1">true</default> + </entry> + <entry name="AiDifficulty$(Player)" type="Enum" key="ai$(Player)Difficulty"> + <parameter name="Player" type="Int" min="0" max="1"/> + <choices> + <choice name="Trainee"/> + <choice name="Normal"/> + <choice name="Hard"/> + <choice name="Insane"/> + </choices> + <default>Normal</default> + </entry> + <entry name="LastConfig" type="Int" key="lastConfig"> + <default>0</default> + </entry> + <entry name="RefreshTime" type="Int" key="refreshTime"> + <default>33</default> + <min>10</min> + <max>100</max> + </entry> + </group> +</kcfg> diff --git a/kspaceduel/kspaceduelui.rc b/kspaceduel/kspaceduelui.rc new file mode 100644 index 00000000..4aab1ba0 --- /dev/null +++ b/kspaceduel/kspaceduelui.rc @@ -0,0 +1,16 @@ +<!DOCTYPE kpartgui> +<kpartgui name="kspaceduel" version="6"> + +<MenuBar> + <Menu name="game"><text>&Game</text> + <Action name="new_round" append="new_merge"/> + </Menu> +</MenuBar> + +<Toolbar name="mainToolBar"><text>Main Toolbar</text> + <Action name="game_new"/> + <Action name="new_round"/> + <Action name="game_pause"/> +</Toolbar> + +</kpartgui> diff --git a/kspaceduel/main.cpp b/kspaceduel/main.cpp new file mode 100644 index 00000000..ab1952b1 --- /dev/null +++ b/kspaceduel/main.cpp @@ -0,0 +1,29 @@ +#include <kapplication.h> +#include <kcmdlineargs.h> +#include <kaboutdata.h> + +#include "version.h" +#include "topwidget.h" + +static const char description[] = I18N_NOOP("KDE Space Game"); + +int main(int argc,char **argv) +{ + KAboutData aboutData( "kspaceduel", I18N_NOOP("KSpaceDuel"), + KSPACEDUEL_VERSION, description, KAboutData::License_GPL, + "(c) 1998-2000, Andreas Zehender"); + aboutData.addAuthor("Andreas Zehender",0, "az@azweb.de"); + KCmdLineArgs::init( argc, argv, &aboutData ); + + KApplication myapplication; + MyTopLevelWidget* top = new MyTopLevelWidget( ); + myapplication.setMainWidget(top); + top->show(); + top->start(); + return myapplication.exec(); +} + +#ifdef kspaceduel_only_for_xgettext +i18n( "Default" ), i18n( "Bullet" ), i18n( "Chaos" ), i18n( "Lack of energy" ) +#endif + diff --git a/kspaceduel/mainview.cpp b/kspaceduel/mainview.cpp new file mode 100644 index 00000000..0d385a49 --- /dev/null +++ b/kspaceduel/mainview.cpp @@ -0,0 +1,1052 @@ +#include "mainview.h" + +#include <math.h> +#include <qbitmap.h> +#include <qfile.h> +#include <qvbox.h> + +#include <kapplication.h> +#include <kaction.h> +#include <klocale.h> +#include <kstandarddirs.h> +#include <kglobalsettings.h> +#include <kconfig.h> +#include <kiconloader.h> + +#include "ai.h" +#include "options.h" + +KToggleAction *MyMainView::pauseAction = 0; + +MyMainView::MyMainView(QWidget *parent) + :QWidget(parent), + field(DEF_WIDTH,DEF_HEIGHT), + view(&field,this) +{ + int i,p; + setMinimumSize(600,400); + random.setSeed(0); + QPixmap backgr(locate("appdata", MV_BACKGROUND)); + field.setBackgroundPixmap(backgr); + + view.setResizePolicy(QScrollView::AutoOne); + view.setHScrollBarMode(QScrollView::AlwaysOff); + view.setVScrollBarMode(QScrollView::AlwaysOff); + + for(p=0;p<2;p++) + { + for(i=0;i<PlayerKeyNum;i++) + playerKeyPressed[p][i]=false; + bulletShot[p]=false; + minePut[p]=false; + } + + QString tmp = KGlobal::dirs()->findResourceDir("appdata", (QString)MV_BACKGROUND); + + QCanvasPixmapArray *sunsequence + = loadOldPixmapSequence( tmp + MV_SUN_PPM, tmp + MV_SUN_PBM ); + sun=new SunSprite(sunsequence, &field); + sun->move(width()/2-1,height()/2-1); + sun->show(); + + explosionsequence = loadOldPixmapSequence( tmp + MV_EXPLOSION_PPM, + tmp + MV_EXPLOSION_PBM, 31 ); + mineexplosionsequence = loadOldPixmapSequence(tmp + MV_MINEEX_PPM, + tmp + MV_MINEEX_PBM, 18 ); + + shipsequence[0] = loadOldPixmapSequence( tmp + MV_SHIP1_PPM, + tmp + MV_SHIP1_PBM, ROTNUM ); + shipsequence[1] = loadOldPixmapSequence( tmp + MV_SHIP2_PPM, + tmp + MV_SHIP2_PBM, ROTNUM); + ship[0]=new ShipSprite(shipsequence[0],&field,0); + ship[1]=new ShipSprite(shipsequence[1],&field,1); + + bulletsequence[0] = loadOldPixmapSequence( tmp + MV_BULLET1_PPM, + tmp + MV_BULLET1_PBM ); + bulletsequence[1] = loadOldPixmapSequence( tmp + MV_BULLET2_PPM, + tmp + MV_BULLET2_PBM ); + minesequence[0] = loadOldPixmapSequence( tmp + MV_MINE1_PPM, + tmp + MV_MINE1_PBM, 2); + minesequence[1] = loadOldPixmapSequence( tmp + MV_MINE2_PPM, + tmp + MV_MINE2_PBM, 2); + powerupsequence[PowerupSprite::PowerupMine] + = loadOldPixmapSequence( tmp + MV_POWERMINE_PPM, tmp + MV_POWERMINE_PBM ); + powerupsequence[PowerupSprite::PowerupBullet] + = loadOldPixmapSequence( tmp + MV_POWERBULLET_PPM, tmp + MV_POWERBULLET_PBM ); + powerupsequence[PowerupSprite::PowerupShield] + = loadOldPixmapSequence( tmp + MV_POWERSHIELD_PPM, tmp + MV_POWERSHIELD_PBM ); + powerupsequence[PowerupSprite::PowerupEnergy] + = loadOldPixmapSequence( tmp + MV_POWERENERGY_PPM, tmp + MV_POWERENERGY_PBM ); + + for(i=0;i<2;i++) + { + // ship[i]->setBoundsAction(QwRealMobileSprite::Wrap); + ship[i]->hide(); + bullets[i]=new QPtrList<BulletSprite>; + bullets[i]->setAutoDelete(true); + mines[i]=new QPtrList<MineSprite>; + mines[i]->setAutoDelete(true); + + } + + explosions.setAutoDelete(true); + powerups.setAutoDelete(true); + + waitForStart=false; + textSprite=0; + readConfig(); +} + +MyMainView::~MyMainView() +{ + killTimers(); + writeConfig(); +} + +void MyMainView::setActionCollection(KActionCollection *a) +{ + actionCollection = a; +} + +void MyMainView::readConfig() +{ + KConfig *cfg = kapp->config(); + int i; + + cfg->setGroup("Game"); + customConfig.gamespeed=cfg->readDoubleNumEntry("gamespeed", + predefinedConfig[0].gamespeed); + + customConfig.gravity= + cfg->readDoubleNumEntry("gravity",predefinedConfig[0].gravity); + customConfig.acc= + cfg->readDoubleNumEntry("acceleration",predefinedConfig[0].acc); + customConfig.bulletDamage= + cfg->readUnsignedNumEntry("bulletDamage",predefinedConfig[0].bulletDamage); + customConfig.bulletLifeTime= + cfg->readDoubleNumEntry("bulletLifeTime",predefinedConfig[0].bulletLifeTime); + customConfig.bulletReloadTime= + cfg->readDoubleNumEntry("bulletReloadTime",predefinedConfig[0].bulletReloadTime); + customConfig.mineDamage= + cfg->readUnsignedNumEntry("mineDamage",predefinedConfig[0].mineDamage); + customConfig.shipDamage= + cfg->readUnsignedNumEntry("shipDamage",predefinedConfig[0].shipDamage); + customConfig.maxBullets= + cfg->readUnsignedNumEntry("maxBullets",predefinedConfig[0].maxBullets); + customConfig.maxMines= + cfg->readUnsignedNumEntry("maxMines",predefinedConfig[0].maxMines); + customConfig.mineReloadTime= + cfg->readDoubleNumEntry("mineReloadTime",predefinedConfig[0].mineReloadTime); + customConfig.rotationSpeed= + cfg->readDoubleNumEntry("rotationSpeed",predefinedConfig[0].rotationSpeed); + customConfig.shotSpeed= + cfg->readDoubleNumEntry("shotSpeed",predefinedConfig[0].shotSpeed); + customConfig.energyNeed= + cfg->readDoubleNumEntry("accEnergyNeed",predefinedConfig[0].energyNeed); + customConfig.rotationEnergyNeed= + cfg->readDoubleNumEntry("rotationEnergyNeed",predefinedConfig[0].rotationEnergyNeed); + customConfig.sunEnergy= + cfg->readDoubleNumEntry("sunEnergy",predefinedConfig[0].sunEnergy); + customConfig.mineActivateTime= + cfg->readDoubleNumEntry("mineActivateTime",predefinedConfig[0].mineActivateTime); + customConfig.mineFuel= + cfg->readDoubleNumEntry("mineFuel",predefinedConfig[0].mineFuel); + customConfig.shotEnergyNeed= + cfg->readDoubleNumEntry("shotEnergyNeed",predefinedConfig[0].shotEnergyNeed); + customConfig.mineEnergyNeed= + cfg->readDoubleNumEntry("mineEnergyNeed",predefinedConfig[0].mineEnergyNeed); + customConfig.startPosX= + cfg->readDoubleNumEntry("startPosX",predefinedConfig[0].startPosX); + customConfig.startPosY= + cfg->readDoubleNumEntry("startPosY",predefinedConfig[0].startPosY); + customConfig.startVelX= + cfg->readDoubleNumEntry("startVelX",predefinedConfig[0].startVelX); + customConfig.startVelY= + cfg->readDoubleNumEntry("startVelY",predefinedConfig[0].startVelY); + customConfig.powerupLifeTime= + cfg->readDoubleNumEntry("powerupLifeTime",predefinedConfig[0].powerupLifeTime); + customConfig.powerupRefreshTime= + cfg->readDoubleNumEntry("powerupRefreshTime",predefinedConfig[0].powerupRefreshTime); + customConfig.powerupShieldAmount= + cfg->readUnsignedNumEntry("powerupShieldAmount", + predefinedConfig[0].powerupShieldAmount); + customConfig.powerupEnergyAmount= + cfg->readDoubleNumEntry("powerupEnergyAmount", + predefinedConfig[0].powerupEnergyAmount); + + if(Options::lastConfig() < predefinedConfigNum) + config=modifyConfig(predefinedConfig[Options::lastConfig()]); + else + config=modifyConfig(customConfig); + + for(i=0;i<2;i++) + ai[i]=new Ai(i,ship,bullets,mines,&config); +} + +void MyMainView::writeConfig() +{ + KConfig *cfg; + cfg=KApplication::kApplication()->config(); + cfg->setGroup("Game"); + + cfg->writeEntry("gravity",customConfig.gravity); + cfg->writeEntry("acceleration",customConfig.acc); + cfg->writeEntry("bulletDamage",customConfig.bulletDamage); + cfg->writeEntry("bulletLifeTime",customConfig.bulletLifeTime); + cfg->writeEntry("bulletReloadTime",customConfig.bulletReloadTime); + cfg->writeEntry("mineDamage",customConfig.mineDamage); + cfg->writeEntry("shipDamage",customConfig.shipDamage); + cfg->writeEntry("maxBullets",customConfig.maxBullets); + cfg->writeEntry("maxMines",customConfig.maxMines); + cfg->writeEntry("rotationSpeed",customConfig.rotationSpeed); + cfg->writeEntry("shotSpeed",customConfig.shotSpeed); + cfg->writeEntry("accEnergyNeed",customConfig.energyNeed); + cfg->writeEntry("rotationEnergyNeed",customConfig.rotationEnergyNeed); + cfg->writeEntry("sunEnergy",customConfig.sunEnergy); + cfg->writeEntry("mineActivateTime",customConfig.mineActivateTime); + cfg->writeEntry("mineReloadTime",customConfig.mineReloadTime); + cfg->writeEntry("mineFuel",customConfig.mineFuel); + cfg->writeEntry("shotEnergyNeed",customConfig.shotEnergyNeed); + cfg->writeEntry("mineEnergyNeed",customConfig.mineEnergyNeed); + + cfg->writeEntry("startPosX",customConfig.startPosX); + cfg->writeEntry("startPosY",customConfig.startPosY); + cfg->writeEntry("startVelX",customConfig.startVelX); + cfg->writeEntry("startVelY",customConfig.startVelY); + + cfg->writeEntry("powerupLifeTime",customConfig.powerupLifeTime); + cfg->writeEntry("powerupRefreshTime",customConfig.powerupRefreshTime); + cfg->writeEntry("powerupShieldAmount",customConfig.powerupShieldAmount); + cfg->writeEntry("powerupEnergyAmount",customConfig.powerupEnergyAmount); +} + +SConfig MyMainView::modifyConfig(SConfig conf) +{ + SConfig newConfig=conf; + newConfig.gamespeed*=Options::refreshTime()/33.0; + newConfig.acc*=newConfig.gamespeed; + newConfig.rotationSpeed*=newConfig.gamespeed*M_PI/ROTNUM*4; + newConfig.energyNeed*=newConfig.gamespeed; + newConfig.rotationEnergyNeed*=newConfig.gamespeed; + newConfig.mineActivateTime*=newConfig.gamespeed; + + return newConfig; +} + +void MyMainView::keyPressEvent(QKeyEvent *ev) +{ + if((gameEnd<=0.0)&&(gameEnd>-2.0)) + { + /* + if(key==options.functionKey[FunctionKeyStart]) + newRound(); + */ + } + else if(waitForStart) + { + /* + if((key==options.functionKey[FunctionKeyStart]) + && (!functionKeyPressed[FunctionKeyStart])) + { + functionKeyPressed[FunctionKeyStart]=true; + resume(); + } + */ + } + else + { + KKey key(ev); + bool accept=true; + + if(actionCollection->action("P1KeyLeft")->shortcut().contains(key)) + playerKeyPressed[0][PlayerKeyLeft]=true; + else if(actionCollection->action("P2KeyLeft")->shortcut().contains(key)) + playerKeyPressed[1][PlayerKeyLeft]=true; + + else if(actionCollection->action("P1KeyRight")->shortcut().contains(key)) + playerKeyPressed[0][PlayerKeyRight]=true; + else if(actionCollection->action("P2KeyRight")->shortcut().contains(key)) + playerKeyPressed[1][PlayerKeyRight]=true; + + else if(actionCollection->action("P1KeyAcc")->shortcut().contains(key)) + playerKeyPressed[0][PlayerKeyAcc]=true; + else if(actionCollection->action("P2KeyAcc")->shortcut().contains(key)) + playerKeyPressed[1][PlayerKeyAcc]=true; + + else if(actionCollection->action("P1Shot")->shortcut().contains(key)) + playerKeyPressed[0][PlayerKeyShot]=true; + else if(actionCollection->action("P2Shot")->shortcut().contains(key)) + playerKeyPressed[1][PlayerKeyShot]=true; + + else if(actionCollection->action("P1Mine")->shortcut().contains(key)) + playerKeyPressed[0][PlayerKeyMine]=true; + else if(actionCollection->action("P2Mine")->shortcut().contains(key)) + playerKeyPressed[1][PlayerKeyMine]=true; + else + accept = false; + /* + if((key==options.functionKey[FunctionKeyStart]) + && (!functionKeyPressed[FunctionKeyStart])) + { + functionKeyPressed[FunctionKeyStart]=true; + pause(); + } + */ + if(!accept) + ev->ignore(); + } +} + +void MyMainView::keyReleaseEvent(QKeyEvent *ev) +{ + KKey key(ev); + bool accept=true; + + if(actionCollection->action("P1KeyLeft")->shortcut().contains(key)) + playerKeyPressed[0][PlayerKeyLeft]=false; + else if(actionCollection->action("P2KeyLeft")->shortcut().contains(key)) + playerKeyPressed[1][PlayerKeyLeft]=false; + + else if(actionCollection->action("P1KeyRight")->shortcut().contains(key)) + playerKeyPressed[0][PlayerKeyRight]=false; + else if(actionCollection->action("P2KeyRight")->shortcut().contains(key)) + playerKeyPressed[1][PlayerKeyRight]=false; + + else if(actionCollection->action("P1KeyAcc")->shortcut().contains(key)) + playerKeyPressed[0][PlayerKeyAcc]=false; + else if(actionCollection->action("P2KeyAcc")->shortcut().contains(key)) + playerKeyPressed[1][PlayerKeyAcc]=false; + + else if(actionCollection->action("P1Shot")->shortcut().contains(key)) + playerKeyPressed[0][PlayerKeyShot]=false; + else if(actionCollection->action("P2Shot")->shortcut().contains(key)) + playerKeyPressed[1][PlayerKeyShot]=false; + + else if(actionCollection->action("P1Mine")->shortcut().contains(key)) + playerKeyPressed[0][PlayerKeyMine]=false; + else if(actionCollection->action("P2Mine")->shortcut().contains(key)) + playerKeyPressed[1][PlayerKeyMine]=false; + else + accept = false; + + if(!accept) + ev->ignore(); +} + +void MyMainView::pause() +{ + if( !waitForStart ) + { + pauseAction->setChecked( true ); + + waitForStart=true; + killTimers(); + emit setStatusText(i18n(" paused "), IDS_PAUSE); + } +} + +void MyMainView::resume() +{ + waitForStart=false; + timerID=startTimer(Options::refreshTime()); + emit(setStatusText("",IDS_PAUSE)); + emit(setStatusText("",IDS_MAIN)); +} + +void MyMainView::start( ) +{ + if( ( gameEnd <= 0.0 ) && ( gameEnd > -2.0 ) ) + { + newRound( ); + } + else if( waitForStart ) + { + waitForStart = false; + timerID=startTimer(Options::refreshTime()); + emit(setStatusText("",IDS_PAUSE)); + emit(setStatusText("",IDS_MAIN)); + pauseAction->setEnabled( true ); + pauseAction->setChecked( false ); + } +} + +void MyMainView::stop() +{ + pauseAction->setEnabled( false ); + pauseAction->setChecked( false ); + + killTimers(); + waitForStart = true; +} + +void MyMainView::togglePause( ) +{ + if( waitForStart ) + resume( ); + else + pause( ); +} + +void MyMainView::resizeEvent(QResizeEvent *event) +{ + double mx,my; + MineSprite *mine; + BulletSprite *bullet; + PowerupSprite *powerup; + int i,current; + + mx=(event->size().width()-event->oldSize().width())/2.0; + my=(event->size().height()-event->oldSize().height())/2.0; + QWidget::resizeEvent(event); + view.resize(width(),height()); + field.resize(width(),height()); + + // printf("%d %d\n",field.width(),field.height()); + sun->move(width()/2-1,height()/2-1); + + for(i=0;i<2;i++) + { + // ship[i]->adoptSpritefieldBounds(); + ship[i]->moveBy(mx,my); + current=mines[i]->at(); + for(mine=mines[i]->first();mine;mine=mines[i]->next()) + { + // mine->adoptSpritefieldBounds(); + mine->moveBy(mx,my); + } + if(current>=0) + mines[i]->at(current); + + current=bullets[i]->at(); + for(bullet=bullets[i]->first();bullet;bullet=bullets[i]->next()) + { + // bullet->adoptSpritefieldBounds(); + bullet->moveBy(mx,my); + } + if(current>=0) + bullets[i]->at(current); + + } + if(textSprite) + textSprite->moveBy((int)mx,(int)my); + current=powerups.at(); + for(powerup=powerups.first();powerup;powerup=powerups.next()) + powerup->moveBy(mx,my); + if(current>=0) + powerups.at(current); +} + +void MyMainView::newRound() +{ + double mx,my; + int i; + + timeToNextPowerup=random.getDouble() * config.powerupRefreshTime; + powerups.clear(); + + killTimers(); + mx=width()/2.0; + my=height()/2.0; + ship[0]->move(mx+config.startPosX,my+config.startPosY); + ship[0]->setRotation(0.0); + ship[0]->setFrame(0); + + ship[1]->move(mx-config.startPosX,my-config.startPosY); + ship[1]->setRotation(M_PI); + ship[1]->setFrame(ROTNUM/2); + + ship[0]->setVelocity(config.startVelX,config.startVelY); + ship[1]->setVelocity(-config.startVelX,-config.startVelY); + for(i=0;i<2;i++) + { + ship[i]->show(); + ship[i]->setEnergy(99.9); + ship[i]->setHitPoints(Options::startHitPoints(i)); + ship[i]->stop(false); + ship[i]->setExplosion(-1); + emit(energy(i,(int)ship[i]->getEnergy())); + emit(hitPoints(i,ship[i]->getHitPoints())); + bulletShot[i]=false; + bullets[i]->clear(); + mines[i]->clear(); + ship[i]->mine(0.0); + ship[i]->bullet(0.0); + ship[i]->setBulletPowerups(0); + ship[i]->setMinePowerups(0); + + ai[i]->newRound(); + } + explosions.clear(); + gameEnd=-10.0; + for(i=0;i<PlayerKeyNum;i++) + { + playerKeyPressed[0][i]=false; + playerKeyPressed[1][i]=false; + } + if(textSprite) + { + textSprite->hide(); + delete textSprite; + textSprite=0; + } + field.update(); + + QString str = i18n("Press %1 to start") + .arg(KShortcut(GAME_START_SHORTCUT).toString()); + emit(setStatusText(str,IDS_MAIN)); + emit( setStatusText( "", IDS_PAUSE ) ); + stop( ); +} + +void MyMainView::newGame() +{ + int i; + for(i=0;i<2;i++) + { + ship[i]->setWins(0); + emit(wins(i,0)); + } + newRound(); +} + +void MyMainView::timerEvent(QTimerEvent *event) +{ + unsigned w; + int i; + bool stopped = false; + + if(event->timerId()==timerID) + { + killTimers(); + if(gameEnd>0.0) + { + gameEnd-=1.0; + if(gameEnd<=0.0) + { + stopped = true; + if(textSprite) + { + textSprite->hide(); + delete textSprite; + textSprite=0; + } + + textSprite=new QCanvasText(&field); + textSprite->move(width()/2,height()/2-90); + textSprite->setTextFlags(AlignCenter); + textSprite->setColor(qRgb(255,160,0)); + textSprite->setFont(QFont(KGlobalSettings::generalFont().family(),14)); + textSprite->show( ); + if(ship[0]->getHitPoints()==0) + { + if(ship[1]->getHitPoints()==0) + textSprite->setText(i18n("draw round")); + else + { + textSprite->setText(i18n("blue player won the round")); + w=ship[1]->getWins()+1; + ship[1]->setWins(w); + emit(wins(1,w)); + } + } + else + { + textSprite->setText(i18n("red player won the round")); + w=ship[0]->getWins()+1; + ship[0]->setWins(w); + emit(wins(0,w)); + } + QString str = i18n("Press %1 for new round") + .arg(KShortcut(GAME_START_SHORTCUT).toString()); + emit(setStatusText(str,IDS_MAIN)); + stop( ); + } + } + + if( !stopped ) + { + for(i=0;i<2;i++) + if(Options::playerIsAi(i)&&(ship[i]->getHitPoints()>0)) + ai[i]->think(); + + moveMines(); + moveBullets(); + moveExplosions(); + moveShips(); + calculatePowerups(); + collisions(); + timerID=startTimer(Options::refreshTime()); + } + field.update(); + } +} + +void MyMainView::moveShips() +{ + int i,nf,olde; + double nx,ny,en,nr; + BulletSprite *bullet; + MineSprite *mine; + + + for(i=0;i<2;i++) + { + bool playerIsAi = Options::playerIsAi(i); + olde=(int)ship[i]->getEnergy(); + if(ship[i]->getHitPoints()==0) + { + ship[i]->forward(config.gamespeed); + ship[i]->calculateGravityAndEnergy(config.gravity,config.sunEnergy, + config.gamespeed); + } + else + { + ship[i]->calculateGravityAndEnergy(config.gravity,config.sunEnergy, + config.gamespeed); + + + if(!playerIsAi&&playerKeyPressed[i][PlayerKeyRight] + || playerIsAi&&ai[i]->rotateRight()) + ship[i]->rotateRight(config.rotationEnergyNeed, + config.rotationSpeed); + + if(!playerIsAi&&playerKeyPressed[i][PlayerKeyLeft] + || playerIsAi&&ai[i]->rotateLeft()) + ship[i]->rotateLeft(config.rotationEnergyNeed, + config.rotationSpeed); + + en=ship[i]->getEnergy(); + nr=ship[i]->getRotation(); + + + nf=ship[i]->frame(); + nx=cos(nr); + ny=sin(nr); + if((!playerIsAi&&playerKeyPressed[i][PlayerKeyAcc] + || playerIsAi&&ai[i]->accelerate()) + &&(en>config.energyNeed)) + { + en-=config.energyNeed; + ship[i]->setVelocity(ship[i]->xVelocity()+nx*config.acc, + ship[i]->yVelocity()-ny*config.acc); + } + if(en>99.9) + en=99.9; + + ship[i]->forward(config.gamespeed); + //Bullets and Mines + if(!playerIsAi&&playerKeyPressed[i][PlayerKeyShot] + ||playerIsAi&&ai[i]->shootBullet()) + { + if((en>config.shotEnergyNeed) && (!ship[i]->reloadsBullet())) + { + if(bullets[i]->count() < + (config.maxBullets+ship[i]->getBulletPowerups())) + { + ship[i]->bullet(config.bulletReloadTime); + en-=config.shotEnergyNeed; + bullet=new BulletSprite(bulletsequence[i],&field,i, + config.bulletLifeTime); + bullet->move(ship[i]->x()+nx*SHOTDIST, + ship[i]->y()-ny*SHOTDIST); + bullet->setVelocity(ship[i]->xVelocity()+nx*config.shotSpeed, + ship[i]->yVelocity()-ny*config.shotSpeed); + // bullet->setBoundsAction(QwRealMobileSprite::Wrap); + bullet->show(); + + bullets[i]->append(bullet); + } + } + } + if(!Options::playerIsAi(i)&&playerKeyPressed[i][PlayerKeyMine] + || Options::playerIsAi(i)&&ai[i]->layMine()) + { + if((en>config.mineEnergyNeed) && (!ship[i]->reloadsMine())) + { + if(mines[i]->count() < + (config.maxMines+ship[i]->getMinePowerups())) + { + ship[i]->mine(config.mineReloadTime); + en-=config.mineEnergyNeed; + mine=new MineSprite(minesequence[i],&field,i, + config.mineActivateTime,config.mineFuel); + mine->move(ship[i]->x(),ship[i]->y()); + mine->setVelocity(0,0); + //mine->setBoundsAction(QwRealMobileSprite::Wrap); + mine->show(); + mines[i]->append(mine); + } + } + } + ship[i]->setEnergy(en); + if(olde!=(int)en) + emit(energy(i,(int)en)); + } + } +} + +void MyMainView::moveMines() +{ + MineSprite* mine; + int p; + + for(p=0;p<2;p++) + { + mine=mines[p]->first(); + while(mine) + { + mine->calculateGravity(config.gravity,config.gamespeed); + mine->forward(config.gamespeed); + if(mine->over()) + { + mine->hide(); + mines[p]->remove(); + mine=mines[p]->current(); + } + else + mine=mines[p]->next(); + } + } +} + +void MyMainView::moveBullets() +{ + int i; + BulletSprite *sp; + + for(i=0;i<2;i++) + { + sp=bullets[i]->first(); + while(sp) + { + sp->calculateGravity(config.gravity,config.gamespeed); + sp->forward(config.gamespeed); + if(sp->timeOut()) + { + sp->hide(); + bullets[i]->removeRef(sp); + sp=bullets[i]->current(); + } + else + sp=bullets[i]->next(); + } + } +} + +void MyMainView::moveExplosions() +{ + ExplosionSprite *ex; + ex=explosions.first(); + while(ex) + { + ex->forward(config.gamespeed); + if(ex->isOver()) + { + explosions.removeRef(ex); + ex=explosions.current(); + } + else + ex=explosions.next(); + } +} + +void MyMainView::calculatePowerups() +{ + PowerupSprite *sp; + int type,x,y; + + sp=powerups.first(); + while(sp) + { + sp->setLifetime(sp->getLifetime()-config.gamespeed); + if(sp->getLifetime()<0) + { + powerups.removeRef(sp); + sp=powerups.current(); + } + else + sp=powerups.next(); + } + timeToNextPowerup-=config.gamespeed; + if(timeToNextPowerup<0) + { + timeToNextPowerup= random.getDouble() * config.powerupRefreshTime; + type= random.getLong(PowerupSprite::PowerupNum); + sp=new PowerupSprite(powerupsequence[type],&field,type, + config.powerupLifeTime); + do + { + x = random.getLong(width()-40)+20; + y = random.getLong(height()-40)+20; + } + while(((x-width()/2)*(x-width()/2)+(y-height()/2)*(y-height()/2))<(50*50)); + sp->move(x,y); + powerups.append(sp); + sp->show(); + } +} + +void MyMainView::collisions() +{ + int pl,hp,op,oldhp[2],ohp; + QCanvasItemList unexact; + QCanvasItem *sprite; + BulletSprite *bullet; + MineSprite *mine; + ExplosionSprite *expl; + ShipSprite *s; + PowerupSprite *power; + QCanvasItemList hitlist; + double ndx[2],ndy[2]; + double en; + QCanvasItemList::Iterator it; + + for(pl=0;pl<2;pl++) + { + if(!ship[pl]->isStopped()) + { + unexact.clear(); + unexact=ship[pl]->collisions(false); + oldhp[pl]=hp=ship[pl]->getHitPoints(); + hitlist.clear(); + for(it=unexact.begin(); it != unexact.end(); ++it) + { + sprite = (*it); + if((sprite->rtti()!=S_EXPLOSION) + && !((sprite->rtti()!=S_SUN)&&(ship[pl]->getHitPoints()==0))) + if(ship[pl]->collidesWith(sprite)) + if(!hitlist.contains(sprite)) + hitlist.append(sprite); + } + + for(it=hitlist.begin(); it != hitlist.end(); ++it) + { + sprite = (*it); + switch(sprite->rtti()) + { + case S_SUN: + hp=0; + ship[pl]->stop(); + break; + case S_BULLET: + bullet=(BulletSprite *)sprite; + bullet->hide(); + bullets[bullet->getPlayerNumber()]->removeRef(bullet); + hp-=config.bulletDamage; + break; + case S_SHIP: + s=(ShipSprite*)sprite; + ohp=s->getHitPoints(); + if(ohp>0) + { + s->setHitPoints(ohp-hp-config.shipDamage); + emit(hitPoints(s->getPlayerNumber(),s->getHitPoints())); + ndx[0]=((1-EPSILON)*ship[0]->xVelocity()+(1+EPSILON)*ship[1]->xVelocity())/2.0; + ndy[0]=((1-EPSILON)*ship[0]->yVelocity()+(1+EPSILON)*ship[1]->yVelocity())/2.0; + ndx[1]=((1-EPSILON)*ship[1]->xVelocity()+(1+EPSILON)*ship[0]->xVelocity())/2.0; + ndy[1]=((1-EPSILON)*ship[1]->yVelocity()+(1+EPSILON)*ship[0]->yVelocity())/2.0; + ship[0]->setVelocity(ndx[0],ndy[0]); + ship[1]->setVelocity(ndx[1],ndy[1]); + hp-=ohp+config.shipDamage; + } + break; + case S_MINE: + mine=(MineSprite *)sprite; + if(mine->isActive()&& !mine->explodes()) + { + mine->explode(mineexplosionsequence); + ndx[0]=(ship[pl]->xVelocity()+0.3*mine->xVelocity())/1.3; + ndy[0]=(ship[pl]->yVelocity()+0.3*mine->yVelocity())/1.3; + ship[pl]->setVelocity(ndx[0],ndy[0]); + mine->setVelocity(ndx[0],ndy[0]); + hp-=config.mineDamage; + } + break; + case S_POWERUP: + power=(PowerupSprite *)sprite; + switch(power->getType()) + { + case PowerupSprite::PowerupShield: + hp+=config.powerupShieldAmount; + break; + case PowerupSprite::PowerupEnergy: + en=ship[pl]->getEnergy()+config.powerupEnergyAmount; + if(en>99) + en=99; + ship[pl]->setEnergy(en); + break; + case PowerupSprite::PowerupMine: + ship[pl]->setMinePowerups( + ship[pl]->getMinePowerups()+1); + break; + case PowerupSprite::PowerupBullet: + ship[pl]->setBulletPowerups( + ship[pl]->getMinePowerups()+1); + break; + } + power->hide(); + powerups.removeRef(power); + break; + } + } + if(hp>99) + hp=99; + ship[pl]->setHitPoints(hp); + } + + for(mine=mines[pl]->first();mine;mine=mines[pl]->next()) + { + if(!mine->explodes()) + { + unexact.clear(); + unexact=mine->collisions(false); + hitlist.clear(); + for( it=unexact.begin(); it != unexact.end(); ++it ) + { + sprite = (*it); + if(sprite->rtti()==S_BULLET) + if(mine->collidesWith(sprite)) + if(!hitlist.contains(sprite)) + hitlist.append(sprite); + } + if(hitlist.count()>0) + { + mine->explode(mineexplosionsequence); + for(it=hitlist.begin(); it != hitlist.end(); ++it) + { + bullet=(BulletSprite*)(*it); + bullets[bullet->getPlayerNumber()]->removeRef(bullet); + } + } + } + } + } + + hitlist.clear(); + unexact.clear(); + unexact=sun->collisions(false); + for( it = unexact.begin(); it != unexact.end(); ++it) + { + sprite=(*it); + switch(sprite->rtti()) + { + case S_BULLET: + if(sun->collidesWith(sprite)) + if(!hitlist.contains(sprite)) + hitlist.append(sprite); + break; + case S_MINE: + if(!((MobileSprite*)sprite)->isStopped()) + if(sun->collidesWith(sprite)) + if(!hitlist.contains(sprite)) + hitlist.append(sprite); + break; + } + } + + for(it=hitlist.begin(); it != hitlist.end(); ++it) + { + sprite=(*it); + switch(sprite->rtti()) + { + case S_BULLET: + bullet=(BulletSprite *)sprite; + bullet->hide(); + bullets[bullet->getPlayerNumber()]->removeRef(bullet); + break; + case S_MINE: + mine=(MineSprite*)sprite; + mine->stop(); + if(!mine->explodes()) + mine->explode(mineexplosionsequence); + break; + } + } + + + for(pl=0;pl<2;pl++) + { + hp=ship[pl]->getHitPoints(); + if(hp!=oldhp[pl]) + emit(hitPoints(pl,hp)); + if((hp==0)&&(ship[pl]->getExplosion()<0)) + { + op=(pl+1)%2; + ship[pl]->setExplosion((int)(EXPLOSION_TIME/config.gamespeed)); + expl=new ExplosionSprite(explosionsequence,&field,ship[pl]); + expl->show(); + explosions.append(expl); + gameEnd=Options::timeAfterKill()/config.gamespeed; + } + } +} + +void MyMainView::gameSetup() +{ + if(!waitForStart) + pause(); + + if (KConfigDialog::showDialog("settings")) + return; + + SettingsDialog *settings=new SettingsDialog(&customConfig,this,"settings"); + connect(settings, SIGNAL(settingsUpdated()),this,SLOT(closeSettings())); + settings->show(); +} + +void MyMainView::closeSettings(){ + if(Options::lastConfig()<predefinedConfigNum) + config=modifyConfig(predefinedConfig[Options::lastConfig()]); + else + config=modifyConfig(customConfig); +} + +QCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const QString& datapattern, + const QString& maskpattern, int framecount) +{ + int image; + QPtrList<QPixmap> pixmaplist; + QPtrList<QPoint> pointlist; + QString dataname, maskname; + QPixmap *pix; + QBitmap *bitmap; + int hotx=0, hoty=0; + QPoint *point; + + for( image=0; image < framecount; image++ ) + { + // #### Why is this a QString?? + dataname.sprintf( datapattern.ascii(), image ); + maskname.sprintf( maskpattern.ascii(), image ); + + QFile file(dataname); + if( file.open( IO_ReadOnly ) ) + { + char line[128]; + file.readLine( line, 128 ); // Skip "P6"/"P3" line + file.readLine( line, 128 ); + + while ( line[0] == '#' ) + { + // Comment line - see if it has additional parameters + if ( 0 == strncmp( line,"# HOTSPOT ", 10 ) ) + sscanf( line+10, "%d %d", &hotx, &hoty); + + file.readLine( line, 128 ); + } + point = new QPoint( hotx, hoty ); + pointlist.append( point ); + } + + pix = new QPixmap( dataname ); + bitmap = new QBitmap( maskname ); + pix->setMask( *bitmap ); + + pixmaplist.append( pix ); + } + + QCanvasPixmapArray* newarray = new QCanvasPixmapArray( pixmaplist, pointlist ); + return newarray; +} + +#include "mainview.moc" diff --git a/kspaceduel/mainview.h b/kspaceduel/mainview.h new file mode 100644 index 00000000..98dd8e15 --- /dev/null +++ b/kspaceduel/mainview.h @@ -0,0 +1,104 @@ +#ifndef __MY_MAIN_VIEW_H +#define __MY_MAIN_VIEW_H + +#include <qwidget.h> +#include <qimage.h> + +class KToggleAction; +class KActionCollection; +#include <krandomsequence.h> + +#include "sprites.h" +#include "dialogs.h" +class Ai; + +#ifdef sun +#undef sun +#endif + +class MyMainView:public QWidget +{ + Q_OBJECT +public: + MyMainView(QWidget *parent=0); + ~MyMainView(); + + static KToggleAction *pauseAction; + void setActionCollection(KActionCollection *a); + +public slots: + void newRound(); + void newGame(); + void togglePause( ); + void pause(); + void resume(); + void start(); + void stop(); + void gameSetup(); + void closeSettings(); + void readConfig(); + void writeConfig(); +signals: + void hitPoints(int pn,int hp); + void energy(int pn,int en); + void wins(int pn,int w); + void setStatusText(const QString & str,int id); + +protected: + virtual void resizeEvent(QResizeEvent *event); + virtual void timerEvent(QTimerEvent *event); + virtual void keyPressEvent(QKeyEvent *event); + virtual void keyReleaseEvent(QKeyEvent *event); + SConfig modifyConfig(SConfig conf); + QCanvasPixmapArray* loadOldPixmapSequence(const QString& datapattern, + const QString& maskpattern, int framecount=1); + void moveShips(); + void moveBullets(); + void moveMines(); + void moveExplosions(); + void calculatePowerups(); + void collisions(); +private: + KActionCollection *actionCollection; + + QCanvas field; + QCanvasView view; + + SConfig customConfig,config; + + int timerID; + bool playerKeyPressed[2][PlayerKeyNum]; + bool bulletShot[2]; + bool minePut[2]; + bool waitForStart; + double gameEnd; + double timeToNextPowerup; + +// sprites + QPtrList<QImage> shipImages; + QPtrList<QPoint> points; + QImage bulletImage; + QCanvasPixmapArray *bulletsequence[2]; + QCanvasPixmapArray *shipsequence[2]; + QCanvasPixmapArray *explosionsequence; + QCanvasPixmapArray *minesequence[2]; + QCanvasPixmapArray *mineexplosionsequence; + QCanvasPixmapArray *powerupsequence[PowerupSprite::PowerupNum]; + + + ShipSprite *ship[2]; + SunSprite *sun; + QCanvasText *textSprite; + QPtrList<BulletSprite> *bullets[2]; + QPtrList<MineSprite> *mines[2]; + QPtrList<ExplosionSprite> explosions; + QPtrList<PowerupSprite> powerups; + + KRandomSequence random; + +//Ai + Ai *ai[2]; + +}; + +#endif diff --git a/kspaceduel/mathroutines.cpp b/kspaceduel/mathroutines.cpp new file mode 100644 index 00000000..4597a3ad --- /dev/null +++ b/kspaceduel/mathroutines.cpp @@ -0,0 +1,41 @@ +#include "mathroutines.h" +#include "math.h" + +double rectToAngle(double x,double y) +{ + double phi=0; + if(fabs(x)<1e-6) + { + if(y>0) + phi=M_PI_2; + else + phi=-M_PI_2; + } + else + { + phi=atan(y/x); + if(x<0) + phi+=M_PI; + } + if(phi>M_PI) + phi-=2*M_PI; + return phi; +} + +double average(double phi1,double phi2) +{ + return phi2+difference(phi1,phi2)/2.0; +} + +double difference(double phi1,double phi2) +{ + double dif; + + dif=phi1-phi2; + while(dif>M_PI) + dif-=2*M_PI; + while(dif<-M_PI) + dif+=2*M_PI; + + return dif; +} diff --git a/kspaceduel/mathroutines.h b/kspaceduel/mathroutines.h new file mode 100644 index 00000000..5363496d --- /dev/null +++ b/kspaceduel/mathroutines.h @@ -0,0 +1,8 @@ +#ifndef _KSD_MR_H +#define _KSD_MR_H + +double rectToAngle(double x,double y); +double average(double phi1,double phi2); +double difference(double phi1,double phi2); + +#endif diff --git a/kspaceduel/options.kcfgc b/kspaceduel/options.kcfgc new file mode 100644 index 00000000..d6356cc7 --- /dev/null +++ b/kspaceduel/options.kcfgc @@ -0,0 +1,5 @@ +# Code generation options for kconfig_compiler +File=kspaceduel.kcfg +ClassName=Options +Singleton=true +Mutators=LastConfig diff --git a/kspaceduel/pics/Makefile.am b/kspaceduel/pics/Makefile.am new file mode 100644 index 00000000..cc7f32c7 --- /dev/null +++ b/kspaceduel/pics/Makefile.am @@ -0,0 +1,2 @@ +kspacedueldir = $(kde_datadir)/kspaceduel/icons +kspaceduel_ICON = AUTO
\ No newline at end of file diff --git a/kspaceduel/pics/cr16-action-spnewgame.png b/kspaceduel/pics/cr16-action-spnewgame.png Binary files differnew file mode 100644 index 00000000..8eb54762 --- /dev/null +++ b/kspaceduel/pics/cr16-action-spnewgame.png diff --git a/kspaceduel/pics/cr16-action-spnewround.png b/kspaceduel/pics/cr16-action-spnewround.png Binary files differnew file mode 100644 index 00000000..a6e89ac9 --- /dev/null +++ b/kspaceduel/pics/cr16-action-spnewround.png diff --git a/kspaceduel/pics/cr16-action-sppausegame.png b/kspaceduel/pics/cr16-action-sppausegame.png Binary files differnew file mode 100644 index 00000000..2459e2e0 --- /dev/null +++ b/kspaceduel/pics/cr16-action-sppausegame.png diff --git a/kspaceduel/pics/cr22-action-spnewgame.png b/kspaceduel/pics/cr22-action-spnewgame.png Binary files differnew file mode 100644 index 00000000..bfe69fa1 --- /dev/null +++ b/kspaceduel/pics/cr22-action-spnewgame.png diff --git a/kspaceduel/pics/cr22-action-spnewround.png b/kspaceduel/pics/cr22-action-spnewround.png Binary files differnew file mode 100644 index 00000000..60122fb6 --- /dev/null +++ b/kspaceduel/pics/cr22-action-spnewround.png diff --git a/kspaceduel/pics/cr22-action-sppausegame.png b/kspaceduel/pics/cr22-action-sppausegame.png Binary files differnew file mode 100644 index 00000000..6f3225f1 --- /dev/null +++ b/kspaceduel/pics/cr22-action-sppausegame.png diff --git a/kspaceduel/pics/cr32-action-spnewgame.png b/kspaceduel/pics/cr32-action-spnewgame.png Binary files differnew file mode 100644 index 00000000..ad797080 --- /dev/null +++ b/kspaceduel/pics/cr32-action-spnewgame.png diff --git a/kspaceduel/pics/cr32-action-spnewround.png b/kspaceduel/pics/cr32-action-spnewround.png Binary files differnew file mode 100644 index 00000000..5488f6d1 --- /dev/null +++ b/kspaceduel/pics/cr32-action-spnewround.png diff --git a/kspaceduel/pics/cr32-action-sppausegame.png b/kspaceduel/pics/cr32-action-sppausegame.png Binary files differnew file mode 100644 index 00000000..483ce4d2 --- /dev/null +++ b/kspaceduel/pics/cr32-action-sppausegame.png diff --git a/kspaceduel/pics/lo16-action-spnewgame.png b/kspaceduel/pics/lo16-action-spnewgame.png Binary files differnew file mode 100644 index 00000000..8eb54762 --- /dev/null +++ b/kspaceduel/pics/lo16-action-spnewgame.png diff --git a/kspaceduel/pics/lo16-action-spnewround.png b/kspaceduel/pics/lo16-action-spnewround.png Binary files differnew file mode 100644 index 00000000..a6e89ac9 --- /dev/null +++ b/kspaceduel/pics/lo16-action-spnewround.png diff --git a/kspaceduel/pics/lo16-action-sppausegame.png b/kspaceduel/pics/lo16-action-sppausegame.png Binary files differnew file mode 100644 index 00000000..2459e2e0 --- /dev/null +++ b/kspaceduel/pics/lo16-action-sppausegame.png diff --git a/kspaceduel/playerinfo.cpp b/kspaceduel/playerinfo.cpp new file mode 100644 index 00000000..1cd2cd31 --- /dev/null +++ b/kspaceduel/playerinfo.cpp @@ -0,0 +1,80 @@ +#include "playerinfo.h" +#include <qpixmap.h> +#include <qtooltip.h> +#include <klocale.h> +#include <kstandarddirs.h> + + +PlayerInfo::PlayerInfo(int pnr,QWidget *parent,const char *name) + :QFrame(parent,name), + lplayer(this),lenergy(this),lwins(this), + hitpoints(2,this),energy(2,this),wins(2,this) +{ + setFixedWidth(45); + setFrameStyle(Panel|Raised); + QString str; + int i; + + lplayer.setFrameStyle(Panel|Sunken); + lplayer.setMargin(0); + QToolTip::add(&lplayer,i18n("Hit points")); + lenergy.setFrameStyle(Panel|Sunken); + lenergy.setMargin(0); + QToolTip::add(&lenergy,i18n("Energy")); + lwins.setFrameStyle(Panel|Sunken); + lwins.setMargin(0); + QToolTip::add(&lwins,i18n("Wins")); + + lplayer.setGeometry(5,5,35,35); + lplayer.setIndent(0); + lenergy.setGeometry(5,80,35,35); + lenergy.setIndent(0); + lwins.setGeometry(5,155,35,35); + lwins.setIndent(0); + + for(i=0;i<4;i++) + { + str = QString::fromLatin1("sprites/playerinfo/ship%1%2.pnm") + .arg(pnr+1) + .arg(i); + pix[i]=new QPixmap(locate("appdata", str)); + } + + lplayer.setPixmap(*pix[0]); + currentPixmap=0; + lenergy.setPixmap(QPixmap(locate("appdata", "sprites/playerinfo/energy.pnm"))); + lwins.setPixmap(QPixmap(locate("appdata", "sprites/playerinfo/win.pnm"))); + + hitpoints.setGeometry(9,45,26,26); + energy.setGeometry(9,120,26,26); + wins.setGeometry(9,195,26,26); + hitpoints.setFrameStyle(NoFrame); + QToolTip::add(&hitpoints,i18n("Hit points")); + energy.setFrameStyle(NoFrame); + QToolTip::add(&energy,i18n("Energy")); + wins.setFrameStyle(NoFrame); + QToolTip::add(&wins,i18n("Wins")); +} + +void PlayerInfo::setHitpoints(int h) +{ + int p=3-h/25; + hitpoints.display(h); + if(p!=currentPixmap) + { + lplayer.setPixmap(*(pix[p])); + currentPixmap=p; + } +} + +void PlayerInfo::setEnergy(int e) +{ + energy.display(e); +} + +void PlayerInfo::setWins(int w) +{ + wins.display(w); +} + +#include "playerinfo.moc" diff --git a/kspaceduel/playerinfo.h b/kspaceduel/playerinfo.h new file mode 100644 index 00000000..e172c982 --- /dev/null +++ b/kspaceduel/playerinfo.h @@ -0,0 +1,26 @@ +#ifndef __PLAYER_INFO_H +#define __PLAYER_INFO_H + +#include <qframe.h> +#include <qlabel.h> +class QPixmap; +#include <qlcdnumber.h> +#include <qcolor.h> + +class PlayerInfo:public QFrame +{ + Q_OBJECT +public: + PlayerInfo(int pnr,QWidget *parent=0,const char *name=0); +public slots: + void setHitpoints(int h); + void setEnergy(int e); + void setWins(int w); +private: + QPixmap* pix[4]; + int currentPixmap; + QLabel lplayer,lenergy,lwins; + QLCDNumber hitpoints,energy,wins; +}; + +#endif diff --git a/kspaceduel/sprites.cpp b/kspaceduel/sprites.cpp new file mode 100644 index 00000000..08eab3c7 --- /dev/null +++ b/kspaceduel/sprites.cpp @@ -0,0 +1,340 @@ +#include "sprites.h" +#include "mathroutines.h" +#include <math.h> + + +SunSprite::SunSprite(QCanvasPixmapArray *seq, QCanvas* canvas) + :QCanvasSprite(seq, canvas) +{ + // doesn't work with Qt 2.2.2 anymore + // setZ(0); +} + + +PowerupSprite::PowerupSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int t, + double lifetime) + :QCanvasSprite(seq, canvas) +{ + time=lifetime; + type=t; +} + + +MobileSprite::MobileSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn) + :QCanvasSprite(seq, canvas) +{ + stopped=false; + playerNumber=pn; +} + +void MobileSprite::forward(double mult, int fr) +{ + if(!stopped) + { + QCanvasSprite::moveBy(xVelocity()*mult,yVelocity()*mult); + checkBounds(); + setFrame(fr); + } + else + setFrame(fr); +} + +void MobileSprite::forward(double mult) +{ + if(!stopped) + { + QCanvasSprite::moveBy(xVelocity()*mult,yVelocity()*mult); + checkBounds(); + } +} + +void MobileSprite::checkBounds() +{ + double cx, cy; + int ch, cw; + + cx = x(); + cy = y(); + ch = canvas()->height(); + cw = canvas()->width(); + + if ( (int)(cx+0.5) < 0 ) + cx = cw - 1 - fmod( -cx, cw ); + else if ( (int)(cx+0.5) > ( cw-1 ) ) + cx = fmod( cx-cw-1, cw ); + if ( (int)(cy+0.5) < 0 ) + cy = ch-1 - fmod( -cy, ch ); + else if ( (int)(cy+0.5) > ( ch-1 ) ) + cy = fmod( cy-ch-1, ch ); + if ( (cx != x()) || (cy != y()) ) + { + // printf("%5.2f %5.2f %5.2f %5.2f\n", x(), y(), cx, cy); + move( cx, cy ); + } +} + +void MobileSprite::calculateGravity(double gravity,double mult) +{ + double abs_2,nx,ny,ex,ey,sq,eg; + + if(!stopped) + { + ex=x()-canvas()->width()/2.0; + ey=y()-canvas()->height()/2.0; + + abs_2=ex*ex+ey*ey; + sq=sqrt(abs_2); + + nx=ex/sq; + ny=ey/sq; + eg=gravity*mult; + setVelocity(xVelocity()-eg*nx/abs_2, + yVelocity()-eg*ny/abs_2); + } +} + +AiSprite MobileSprite::toAiSprite() +{ + // y direction: screen: bottom to top + // mathematical: top to bottom + AiSprite as; + as.x=x()-canvas()->width()/2.0; + as.y=-(y()-canvas()->height()/2.0); + as.dx=xVelocity(); + as.dy=-yVelocity(); + as.sun=false; + as.border=false; + return as; +} + +ShipSprite::ShipSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn) + :MobileSprite(seq,canvas,pn) +{ + hitpoints=99; + energy=99.9; + explosion=-1; + setZ(-20); + rotation=0; + bulletPowerups=0; + minePowerups=0; +} + +void ShipSprite::setRotation(double r) +{ + int nf,of=frame(); + rotation=r; + if(rotation<0) + rotation-=((int)(rotation/(2*M_PI))-1)*2*M_PI; + if(rotation>=2*M_PI) + rotation-=(int)(rotation/(2*M_PI))*2*M_PI; + nf=(int)(rotation/(2*M_PI)*ROTNUM)%ROTNUM; + if(nf!=of) + setFrame(nf); +} + +void ShipSprite::forward(double mult) +{ + MobileSprite::forward(mult); + if(explosion>0) + { + explosion--; + if(explosion==0) + hide(); + } + if(reloadBulletTime>0) + reloadBulletTime-=mult; + if(reloadMineTime>0) + reloadMineTime-=mult; +} + +void ShipSprite::forward(double mult,int fr) +{ + MobileSprite::forward(mult,fr); + rotation=fr/ROTNUM*M_PI*2; + if(explosion>0) + { + explosion--; + if(explosion==0) + hide(); + } + if(reloadBulletTime>0) + reloadBulletTime-=mult; + if(reloadMineTime>0) + reloadMineTime-=mult; +} + +void ShipSprite::calculateGravityAndEnergy(double gravity,double sunEnergy, + double mult) +{ + double nx,ny,ex,ey,abs_2,phi,sq,eg; + + if(!stopped) + { + ex=x()-canvas()->width()/2.0; + ey=y()-canvas()->height()/2.0; + + abs_2=ex*ex+ey*ey; + sq=sqrt(abs_2); + + if ( explodes() && (sq<20) ) + stopped = true; + else + { + nx=ex/sq; + ny=ey/sq; + eg=gravity*mult; + setVelocity(xVelocity()-eg*nx/abs_2, + yVelocity()-eg*ny/abs_2); + if(hitpoints!=0) + { + if(energy<99.8) + { + phi=rectToAngle(nx,ny); + energy+=fabs(sunEnergy*mult/(abs_2)*cos(phi+rotation)); + } + } + } + } +} + +void ShipSprite::rotateRight(double rotationEnergyNeed,double rotationSpeed) +{ + if(energy>rotationEnergyNeed) + { + energy-=rotationEnergyNeed; + setRotation(rotation-rotationSpeed); + } +} + +void ShipSprite::rotateLeft(double rotationEnergyNeed,double rotationSpeed) +{ + if(energy>rotationEnergyNeed) + { + energy-=rotationEnergyNeed; + setRotation(rotation+rotationSpeed); + } +} + +BulletSprite::BulletSprite(QCanvasPixmapArray* seq,QCanvas* canvas, int pn,double lifetime) + :MobileSprite(seq,canvas,pn) +{ + setZ(-10); + time=lifetime; +} + +void BulletSprite::forward(double mult) +{ + MobileSprite::forward(mult); + time-=mult; +} + +void BulletSprite::forward(double mult,int fr) +{ + MobileSprite::forward(mult,fr); + time-=mult; +} + +MineSprite::MineSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn,double atime,double f) + :MobileSprite(seq,canvas,pn) +{ + activateTime=atime; + setZ(-25); + fuel=f; + explosiontime=0; + timeToGo=0.0; + expl=false; + active=false; +} + +void MineSprite::explode(QCanvasPixmapArray *seq) +{ + setSequence(seq); + timeToGo=seq->count(); + expl=true; + setFrame(0); + explosiontime=0.0; + setZ(-8); + setFuel(0.0); +} + +void MineSprite::forward(double mult) +{ + if(active) + { + if(expl) + { + explosiontime+=mult; + if(explosiontime>(timeToGo-0.001)) + explosiontime=timeToGo-0.01; + setFrame((int)explosiontime); + } + } + else + { + activateTime-=(double)mult; + if(activateTime<0.0) + { + active=true; + setFrame(1); + } + } + if(fuel<0.001) + MobileSprite::forward(mult); +} + +void MineSprite::calculateGravity(double gravity,double mult) +{ + double abs_2,nx,ny,ex,ey,sq,eg; + + if(!stopped) + { + ex=x()-canvas()->width()/2.0; + ey=y()-canvas()->height()/2.0; + + abs_2=ex*ex+ey*ey; + sq=sqrt(abs_2); + nx=ex/sq; + ny=ey/sq; + eg=gravity*mult; + if(fuel<0.001) + setVelocity(xVelocity()-eg*nx/abs_2, + yVelocity()-eg*ny/abs_2); + else + fuel-=eg/abs_2; + } +} + +ExplosionSprite::ExplosionSprite(QCanvasPixmapArray* seq, QCanvas* canvas, MobileSprite *sp) + :QCanvasSprite(seq, canvas) +{ + over=false; + setZ(-5); + obj=sp; + timeToGo=seq->count(); + time=0; + + move(sp->x(),sp->y()); +} + +void ExplosionSprite::forward(double mult) +{ + int of=frame(); + move(obj->x(),obj->y()); + time+=mult; + + if(time>=timeToGo) + { + over=true; + hide(); + } + else + if((int)time!=of) + setFrame((int)time); +} + + +void ExplosionSprite::setSequence(QCanvasPixmapArray *seq) +{ + timeToGo=seq->count(); + QCanvasSprite::setSequence(seq); +} diff --git a/kspaceduel/sprites.h b/kspaceduel/sprites.h new file mode 100644 index 00000000..0d0b1fb3 --- /dev/null +++ b/kspaceduel/sprites.h @@ -0,0 +1,143 @@ +#ifndef __SPRITE_OBJECTS_H +#define __SPRITE_OBJECTS_H + +#include <qcanvas.h> +#include "defines.h" + +#ifdef sun +#undef sun +#endif + +struct AiSprite +{ + double x,y,dx,dy; + bool sun, border; +}; + +class SunSprite:public QCanvasSprite +{ +public: + SunSprite(QCanvasPixmapArray* seq, QCanvas* canvas); + virtual int rtti() const {return S_SUN;} +}; + + +class PowerupSprite:public QCanvasSprite +{ +public: + enum {PowerupMine=0, PowerupBullet, PowerupShield, PowerupEnergy, + PowerupNum}; + PowerupSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int t, double lifetime); + virtual int rtti() const {return S_POWERUP;} + + double getLifetime() {return time;} + void setLifetime(double t) {time=t;} + int getType() {return type;} +private: + double time; + int type; +}; + +class MobileSprite:public QCanvasSprite +{ +public: + MobileSprite(QCanvasPixmapArray* array, QCanvas* canvas, int pn); + + virtual void forward(double mult,int frame); + virtual void forward(double mult); + virtual void calculateGravity(double gravity,double mult); + int spriteFieldWidth(){return canvas()->width();} + int spriteFieldHeight(){return canvas()->height();} + AiSprite toAiSprite(); + + bool isStopped() {return stopped;} + void stop(bool s=true) {stopped=s;} + int getPlayerNumber() {return playerNumber;} +protected: + void checkBounds(); + bool stopped; + int playerNumber; +}; + + +class ShipSprite:public MobileSprite +{ +public: + ShipSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn); + virtual int rtti() const {return S_SHIP;} + int getHitPoints() {return hitpoints;} + void setHitPoints(int hp) {hitpoints=(hp<0?0:hp);} + double getEnergy() {return energy;} + void setEnergy(double e) {energy=(e<0?0:e);} + void setWins(int w) {wins=w;} + int getWins() {return wins;} + void setExplosion(int f) {explosion=f;} + int getExplosion() {return explosion;} + void setRotation(double r); + double getRotation() {return rotation;} + void rotateRight(double rotationEnergyNeed,double rotationSpeed); + void rotateLeft(double rotationEnergyNeed,double rotationSpeed); + void bullet(double reloadTime) {reloadBulletTime=reloadTime;} + bool reloadsBullet(double t=0.0) {return reloadBulletTime>t;} + void mine(double reloadTime) {reloadMineTime=reloadTime;} + bool reloadsMine(double t=0.0) {return reloadMineTime>t;} + bool explodes() {return explosion>=0;} + void setMinePowerups(int m) {minePowerups=m;} + int getMinePowerups() {return minePowerups;} + void setBulletPowerups(int b) {bulletPowerups=b;} + int getBulletPowerups() {return bulletPowerups;} + virtual void forward(double mult); + virtual void forward(double mult,int fr); + virtual void calculateGravityAndEnergy(double gravity,double sunEnergy, + double mult); +private: + int hitpoints, wins, explosion; + double energy,rotation,reloadBulletTime,reloadMineTime; + int bulletPowerups,minePowerups; +}; + +class BulletSprite:public MobileSprite +{ +public: + BulletSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn,double lifetime); + virtual int rtti() const {return S_BULLET;} + virtual void forward(double mult); + virtual void forward(double mult,int fr); + bool timeOut() {return time<=0;} +private: + double time; +}; + +class MineSprite:public MobileSprite +{ +public: + MineSprite(QCanvasPixmapArray* seq, QCanvas* canvas, int pn,double atime,double f); + virtual int rtti() const {return S_MINE;} + bool isActive() {return active;} + double getFuel() {return fuel;} + void setFuel(double f) {fuel=(f<0.0?0.0:f);} + virtual void forward(double mult); + void explode(QCanvasPixmapArray* s); + bool explodes() {return expl;} + bool over() {return (expl&&(explosiontime>(timeToGo-0.1)));} + virtual void calculateGravity(double gravity,double mult); +private: + bool expl,active; + double activateTime,fuel,timeToGo,explosiontime; +}; + +class ExplosionSprite:public QCanvasSprite +{ +public: + ExplosionSprite(QCanvasPixmapArray *seq, QCanvas* field, MobileSprite *sp); + virtual int rtti() const {return S_EXPLOSION;} + bool isOver() {return over;} + virtual void forward(double mult); + void setSequence(QCanvasPixmapArray *seq); +private: + double timeToGo,time; + bool over; + MobileSprite *obj; +}; + +#endif diff --git a/kspaceduel/sprites/Makefile.am b/kspaceduel/sprites/Makefile.am new file mode 100644 index 00000000..58bce015 --- /dev/null +++ b/kspaceduel/sprites/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = ship1 ship2 playerinfo explosion sun powerups + +bgdir = $(kde_datadir)/kspaceduel/sprites +bg_DATA = backgr.png + +EXTRA_DIST = $(bg_DATA) diff --git a/kspaceduel/sprites/backgr.png b/kspaceduel/sprites/backgr.png Binary files differnew file mode 100644 index 00000000..3b30f396 --- /dev/null +++ b/kspaceduel/sprites/backgr.png diff --git a/kspaceduel/sprites/explosion/Makefile.am b/kspaceduel/sprites/explosion/Makefile.am new file mode 100644 index 00000000..680ffbb1 --- /dev/null +++ b/kspaceduel/sprites/explosion/Makefile.am @@ -0,0 +1,26 @@ + +expldir = $(kde_datadir)/kspaceduel/sprites/explosion + +expl_DATA = \ +explos00.pbm explos00.ppm explos01.pbm explos01.ppm explos02.pbm \ +explos02.ppm explos03.pbm explos03.ppm explos04.pbm explos04.ppm \ +explos05.pbm explos05.ppm explos06.pbm explos06.ppm explos07.pbm \ +explos07.ppm explos08.pbm explos08.ppm explos09.pbm explos09.ppm \ +explos10.pbm explos10.ppm explos11.pbm explos11.ppm explos12.pbm \ +explos12.ppm explos13.pbm explos13.ppm explos14.pbm explos14.ppm \ +explos15.pbm explos15.ppm explos16.pbm explos16.ppm explos17.pbm \ +explos17.ppm explos18.pbm explos18.ppm explos19.pbm explos19.ppm \ +explos20.pbm explos20.ppm explos21.pbm explos21.ppm explos22.pbm \ +explos22.ppm explos23.pbm explos23.ppm explos24.pbm explos24.ppm \ +explos25.pbm explos25.ppm explos26.pbm explos26.ppm explos27.pbm \ +explos27.ppm explos28.pbm explos28.ppm explos29.pbm explos29.ppm \ +explos30.pbm explos30.ppm mineex00.pbm mineex00.ppm mineex01.pbm \ +mineex01.ppm mineex02.pbm mineex02.ppm mineex03.pbm mineex03.ppm \ +mineex04.pbm mineex04.ppm mineex05.pbm mineex05.ppm mineex06.pbm \ +mineex06.ppm mineex07.pbm mineex07.ppm mineex08.pbm mineex08.ppm \ +mineex09.pbm mineex09.ppm mineex10.pbm mineex10.ppm mineex11.pbm \ +mineex11.ppm mineex12.pbm mineex12.ppm mineex13.pbm mineex13.ppm \ +mineex14.pbm mineex14.ppm mineex15.pbm mineex15.ppm mineex16.pbm \ +mineex16.ppm mineex17.pbm mineex17.ppm + +EXTRA_DIST = $(expl_DATA) diff --git a/kspaceduel/sprites/explosion/explos00.pbm b/kspaceduel/sprites/explosion/explos00.pbm Binary files differnew file mode 100644 index 00000000..9b57de08 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos00.pbm diff --git a/kspaceduel/sprites/explosion/explos00.ppm b/kspaceduel/sprites/explosion/explos00.ppm Binary files differnew file mode 100644 index 00000000..1a9d7f3e --- /dev/null +++ b/kspaceduel/sprites/explosion/explos00.ppm diff --git a/kspaceduel/sprites/explosion/explos01.pbm b/kspaceduel/sprites/explosion/explos01.pbm Binary files differnew file mode 100644 index 00000000..30c4f701 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos01.pbm diff --git a/kspaceduel/sprites/explosion/explos01.ppm b/kspaceduel/sprites/explosion/explos01.ppm Binary files differnew file mode 100644 index 00000000..5c5d90e9 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos01.ppm diff --git a/kspaceduel/sprites/explosion/explos02.pbm b/kspaceduel/sprites/explosion/explos02.pbm Binary files differnew file mode 100644 index 00000000..8624bbec --- /dev/null +++ b/kspaceduel/sprites/explosion/explos02.pbm diff --git a/kspaceduel/sprites/explosion/explos02.ppm b/kspaceduel/sprites/explosion/explos02.ppm Binary files differnew file mode 100644 index 00000000..bfd07769 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos02.ppm diff --git a/kspaceduel/sprites/explosion/explos03.pbm b/kspaceduel/sprites/explosion/explos03.pbm Binary files differnew file mode 100644 index 00000000..e9037df3 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos03.pbm diff --git a/kspaceduel/sprites/explosion/explos03.ppm b/kspaceduel/sprites/explosion/explos03.ppm Binary files differnew file mode 100644 index 00000000..ec9c071d --- /dev/null +++ b/kspaceduel/sprites/explosion/explos03.ppm diff --git a/kspaceduel/sprites/explosion/explos04.pbm b/kspaceduel/sprites/explosion/explos04.pbm Binary files differnew file mode 100644 index 00000000..906679f0 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos04.pbm diff --git a/kspaceduel/sprites/explosion/explos04.ppm b/kspaceduel/sprites/explosion/explos04.ppm Binary files differnew file mode 100644 index 00000000..f3b098bc --- /dev/null +++ b/kspaceduel/sprites/explosion/explos04.ppm diff --git a/kspaceduel/sprites/explosion/explos05.pbm b/kspaceduel/sprites/explosion/explos05.pbm Binary files differnew file mode 100644 index 00000000..086068b8 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos05.pbm diff --git a/kspaceduel/sprites/explosion/explos05.ppm b/kspaceduel/sprites/explosion/explos05.ppm Binary files differnew file mode 100644 index 00000000..8154989f --- /dev/null +++ b/kspaceduel/sprites/explosion/explos05.ppm diff --git a/kspaceduel/sprites/explosion/explos06.pbm b/kspaceduel/sprites/explosion/explos06.pbm Binary files differnew file mode 100644 index 00000000..ff19e016 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos06.pbm diff --git a/kspaceduel/sprites/explosion/explos06.ppm b/kspaceduel/sprites/explosion/explos06.ppm Binary files differnew file mode 100644 index 00000000..d86e535c --- /dev/null +++ b/kspaceduel/sprites/explosion/explos06.ppm diff --git a/kspaceduel/sprites/explosion/explos07.pbm b/kspaceduel/sprites/explosion/explos07.pbm Binary files differnew file mode 100644 index 00000000..cefd17af --- /dev/null +++ b/kspaceduel/sprites/explosion/explos07.pbm diff --git a/kspaceduel/sprites/explosion/explos07.ppm b/kspaceduel/sprites/explosion/explos07.ppm Binary files differnew file mode 100644 index 00000000..0f515a5f --- /dev/null +++ b/kspaceduel/sprites/explosion/explos07.ppm diff --git a/kspaceduel/sprites/explosion/explos08.pbm b/kspaceduel/sprites/explosion/explos08.pbm Binary files differnew file mode 100644 index 00000000..38fd3aa8 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos08.pbm diff --git a/kspaceduel/sprites/explosion/explos08.ppm b/kspaceduel/sprites/explosion/explos08.ppm Binary files differnew file mode 100644 index 00000000..3eaa4a62 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos08.ppm diff --git a/kspaceduel/sprites/explosion/explos09.pbm b/kspaceduel/sprites/explosion/explos09.pbm Binary files differnew file mode 100644 index 00000000..bc015285 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos09.pbm diff --git a/kspaceduel/sprites/explosion/explos09.ppm b/kspaceduel/sprites/explosion/explos09.ppm Binary files differnew file mode 100644 index 00000000..69f574b3 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos09.ppm diff --git a/kspaceduel/sprites/explosion/explos10.pbm b/kspaceduel/sprites/explosion/explos10.pbm Binary files differnew file mode 100644 index 00000000..e031712c --- /dev/null +++ b/kspaceduel/sprites/explosion/explos10.pbm diff --git a/kspaceduel/sprites/explosion/explos10.ppm b/kspaceduel/sprites/explosion/explos10.ppm Binary files differnew file mode 100644 index 00000000..65eaff0d --- /dev/null +++ b/kspaceduel/sprites/explosion/explos10.ppm diff --git a/kspaceduel/sprites/explosion/explos11.pbm b/kspaceduel/sprites/explosion/explos11.pbm Binary files differnew file mode 100644 index 00000000..e8021289 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos11.pbm diff --git a/kspaceduel/sprites/explosion/explos11.ppm b/kspaceduel/sprites/explosion/explos11.ppm Binary files differnew file mode 100644 index 00000000..d2dc949e --- /dev/null +++ b/kspaceduel/sprites/explosion/explos11.ppm diff --git a/kspaceduel/sprites/explosion/explos12.pbm b/kspaceduel/sprites/explosion/explos12.pbm Binary files differnew file mode 100644 index 00000000..0e073796 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos12.pbm diff --git a/kspaceduel/sprites/explosion/explos12.ppm b/kspaceduel/sprites/explosion/explos12.ppm Binary files differnew file mode 100644 index 00000000..acaa96e1 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos12.ppm diff --git a/kspaceduel/sprites/explosion/explos13.pbm b/kspaceduel/sprites/explosion/explos13.pbm Binary files differnew file mode 100644 index 00000000..05179167 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos13.pbm diff --git a/kspaceduel/sprites/explosion/explos13.ppm b/kspaceduel/sprites/explosion/explos13.ppm Binary files differnew file mode 100644 index 00000000..43c4e5de --- /dev/null +++ b/kspaceduel/sprites/explosion/explos13.ppm diff --git a/kspaceduel/sprites/explosion/explos14.pbm b/kspaceduel/sprites/explosion/explos14.pbm Binary files differnew file mode 100644 index 00000000..d09e77ac --- /dev/null +++ b/kspaceduel/sprites/explosion/explos14.pbm diff --git a/kspaceduel/sprites/explosion/explos14.ppm b/kspaceduel/sprites/explosion/explos14.ppm Binary files differnew file mode 100644 index 00000000..14ed717a --- /dev/null +++ b/kspaceduel/sprites/explosion/explos14.ppm diff --git a/kspaceduel/sprites/explosion/explos15.pbm b/kspaceduel/sprites/explosion/explos15.pbm Binary files differnew file mode 100644 index 00000000..6ef019bb --- /dev/null +++ b/kspaceduel/sprites/explosion/explos15.pbm diff --git a/kspaceduel/sprites/explosion/explos15.ppm b/kspaceduel/sprites/explosion/explos15.ppm Binary files differnew file mode 100644 index 00000000..3ae97336 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos15.ppm diff --git a/kspaceduel/sprites/explosion/explos16.pbm b/kspaceduel/sprites/explosion/explos16.pbm Binary files differnew file mode 100644 index 00000000..8a6f41b7 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos16.pbm diff --git a/kspaceduel/sprites/explosion/explos16.ppm b/kspaceduel/sprites/explosion/explos16.ppm Binary files differnew file mode 100644 index 00000000..9a62a486 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos16.ppm diff --git a/kspaceduel/sprites/explosion/explos17.pbm b/kspaceduel/sprites/explosion/explos17.pbm Binary files differnew file mode 100644 index 00000000..ff8f8373 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos17.pbm diff --git a/kspaceduel/sprites/explosion/explos17.ppm b/kspaceduel/sprites/explosion/explos17.ppm Binary files differnew file mode 100644 index 00000000..5fb061fa --- /dev/null +++ b/kspaceduel/sprites/explosion/explos17.ppm diff --git a/kspaceduel/sprites/explosion/explos18.pbm b/kspaceduel/sprites/explosion/explos18.pbm Binary files differnew file mode 100644 index 00000000..863eb7d0 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos18.pbm diff --git a/kspaceduel/sprites/explosion/explos18.ppm b/kspaceduel/sprites/explosion/explos18.ppm Binary files differnew file mode 100644 index 00000000..0d892a7a --- /dev/null +++ b/kspaceduel/sprites/explosion/explos18.ppm diff --git a/kspaceduel/sprites/explosion/explos19.pbm b/kspaceduel/sprites/explosion/explos19.pbm Binary files differnew file mode 100644 index 00000000..e9873fcf --- /dev/null +++ b/kspaceduel/sprites/explosion/explos19.pbm diff --git a/kspaceduel/sprites/explosion/explos19.ppm b/kspaceduel/sprites/explosion/explos19.ppm Binary files differnew file mode 100644 index 00000000..a2a24916 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos19.ppm diff --git a/kspaceduel/sprites/explosion/explos20.pbm b/kspaceduel/sprites/explosion/explos20.pbm Binary files differnew file mode 100644 index 00000000..23dbee36 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos20.pbm diff --git a/kspaceduel/sprites/explosion/explos20.ppm b/kspaceduel/sprites/explosion/explos20.ppm Binary files differnew file mode 100644 index 00000000..0de63929 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos20.ppm diff --git a/kspaceduel/sprites/explosion/explos21.pbm b/kspaceduel/sprites/explosion/explos21.pbm Binary files differnew file mode 100644 index 00000000..df4d3d39 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos21.pbm diff --git a/kspaceduel/sprites/explosion/explos21.ppm b/kspaceduel/sprites/explosion/explos21.ppm Binary files differnew file mode 100644 index 00000000..c1d74f3a --- /dev/null +++ b/kspaceduel/sprites/explosion/explos21.ppm diff --git a/kspaceduel/sprites/explosion/explos22.pbm b/kspaceduel/sprites/explosion/explos22.pbm Binary files differnew file mode 100644 index 00000000..d2c04460 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos22.pbm diff --git a/kspaceduel/sprites/explosion/explos22.ppm b/kspaceduel/sprites/explosion/explos22.ppm Binary files differnew file mode 100644 index 00000000..bffedc3d --- /dev/null +++ b/kspaceduel/sprites/explosion/explos22.ppm diff --git a/kspaceduel/sprites/explosion/explos23.pbm b/kspaceduel/sprites/explosion/explos23.pbm Binary files differnew file mode 100644 index 00000000..10942982 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos23.pbm diff --git a/kspaceduel/sprites/explosion/explos23.ppm b/kspaceduel/sprites/explosion/explos23.ppm Binary files differnew file mode 100644 index 00000000..f26992f1 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos23.ppm diff --git a/kspaceduel/sprites/explosion/explos24.pbm b/kspaceduel/sprites/explosion/explos24.pbm Binary files differnew file mode 100644 index 00000000..665e10b9 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos24.pbm diff --git a/kspaceduel/sprites/explosion/explos24.ppm b/kspaceduel/sprites/explosion/explos24.ppm Binary files differnew file mode 100644 index 00000000..17f0203e --- /dev/null +++ b/kspaceduel/sprites/explosion/explos24.ppm diff --git a/kspaceduel/sprites/explosion/explos25.pbm b/kspaceduel/sprites/explosion/explos25.pbm Binary files differnew file mode 100644 index 00000000..30fda10b --- /dev/null +++ b/kspaceduel/sprites/explosion/explos25.pbm diff --git a/kspaceduel/sprites/explosion/explos25.ppm b/kspaceduel/sprites/explosion/explos25.ppm Binary files differnew file mode 100644 index 00000000..877a9c28 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos25.ppm diff --git a/kspaceduel/sprites/explosion/explos26.pbm b/kspaceduel/sprites/explosion/explos26.pbm Binary files differnew file mode 100644 index 00000000..351a035a --- /dev/null +++ b/kspaceduel/sprites/explosion/explos26.pbm diff --git a/kspaceduel/sprites/explosion/explos26.ppm b/kspaceduel/sprites/explosion/explos26.ppm Binary files differnew file mode 100644 index 00000000..ee488917 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos26.ppm diff --git a/kspaceduel/sprites/explosion/explos27.pbm b/kspaceduel/sprites/explosion/explos27.pbm Binary files differnew file mode 100644 index 00000000..d98ea215 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos27.pbm diff --git a/kspaceduel/sprites/explosion/explos27.ppm b/kspaceduel/sprites/explosion/explos27.ppm Binary files differnew file mode 100644 index 00000000..96e26dd8 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos27.ppm diff --git a/kspaceduel/sprites/explosion/explos28.pbm b/kspaceduel/sprites/explosion/explos28.pbm Binary files differnew file mode 100644 index 00000000..dc872400 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos28.pbm diff --git a/kspaceduel/sprites/explosion/explos28.ppm b/kspaceduel/sprites/explosion/explos28.ppm Binary files differnew file mode 100644 index 00000000..692ff55d --- /dev/null +++ b/kspaceduel/sprites/explosion/explos28.ppm diff --git a/kspaceduel/sprites/explosion/explos29.pbm b/kspaceduel/sprites/explosion/explos29.pbm Binary files differnew file mode 100644 index 00000000..e67a072f --- /dev/null +++ b/kspaceduel/sprites/explosion/explos29.pbm diff --git a/kspaceduel/sprites/explosion/explos29.ppm b/kspaceduel/sprites/explosion/explos29.ppm Binary files differnew file mode 100644 index 00000000..5ba8adfe --- /dev/null +++ b/kspaceduel/sprites/explosion/explos29.ppm diff --git a/kspaceduel/sprites/explosion/explos30.pbm b/kspaceduel/sprites/explosion/explos30.pbm Binary files differnew file mode 100644 index 00000000..63cce7e5 --- /dev/null +++ b/kspaceduel/sprites/explosion/explos30.pbm diff --git a/kspaceduel/sprites/explosion/explos30.ppm b/kspaceduel/sprites/explosion/explos30.ppm Binary files differnew file mode 100644 index 00000000..44c38d5d --- /dev/null +++ b/kspaceduel/sprites/explosion/explos30.ppm diff --git a/kspaceduel/sprites/explosion/mineex00.pbm b/kspaceduel/sprites/explosion/mineex00.pbm new file mode 100644 index 00000000..0924b0cb --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex00.pbm @@ -0,0 +1,13 @@ +P1 +8 11 +00001000 +00111110 +01111110 +11111111 +11111111 +11111111 +11111111 +11111111 +11111110 +01111110 +00111100 diff --git a/kspaceduel/sprites/explosion/mineex00.ppm b/kspaceduel/sprites/explosion/mineex00.ppm Binary files differnew file mode 100644 index 00000000..80f7c3aa --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex00.ppm diff --git a/kspaceduel/sprites/explosion/mineex01.pbm b/kspaceduel/sprites/explosion/mineex01.pbm Binary files differnew file mode 100644 index 00000000..d2e5487b --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex01.pbm diff --git a/kspaceduel/sprites/explosion/mineex01.ppm b/kspaceduel/sprites/explosion/mineex01.ppm Binary files differnew file mode 100644 index 00000000..514a1d77 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex01.ppm diff --git a/kspaceduel/sprites/explosion/mineex02.pbm b/kspaceduel/sprites/explosion/mineex02.pbm Binary files differnew file mode 100644 index 00000000..d9b584f6 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex02.pbm diff --git a/kspaceduel/sprites/explosion/mineex02.ppm b/kspaceduel/sprites/explosion/mineex02.ppm Binary files differnew file mode 100644 index 00000000..a4ddccd4 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex02.ppm diff --git a/kspaceduel/sprites/explosion/mineex03.pbm b/kspaceduel/sprites/explosion/mineex03.pbm Binary files differnew file mode 100644 index 00000000..fce5deee --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex03.pbm diff --git a/kspaceduel/sprites/explosion/mineex03.ppm b/kspaceduel/sprites/explosion/mineex03.ppm Binary files differnew file mode 100644 index 00000000..baba3afc --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex03.ppm diff --git a/kspaceduel/sprites/explosion/mineex04.pbm b/kspaceduel/sprites/explosion/mineex04.pbm Binary files differnew file mode 100644 index 00000000..7ed25873 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex04.pbm diff --git a/kspaceduel/sprites/explosion/mineex04.ppm b/kspaceduel/sprites/explosion/mineex04.ppm Binary files differnew file mode 100644 index 00000000..752ab4c8 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex04.ppm diff --git a/kspaceduel/sprites/explosion/mineex05.pbm b/kspaceduel/sprites/explosion/mineex05.pbm Binary files differnew file mode 100644 index 00000000..e16f95cc --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex05.pbm diff --git a/kspaceduel/sprites/explosion/mineex05.ppm b/kspaceduel/sprites/explosion/mineex05.ppm Binary files differnew file mode 100644 index 00000000..c36b15cd --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex05.ppm diff --git a/kspaceduel/sprites/explosion/mineex06.pbm b/kspaceduel/sprites/explosion/mineex06.pbm Binary files differnew file mode 100644 index 00000000..54fbd102 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex06.pbm diff --git a/kspaceduel/sprites/explosion/mineex06.ppm b/kspaceduel/sprites/explosion/mineex06.ppm Binary files differnew file mode 100644 index 00000000..abaaca8c --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex06.ppm diff --git a/kspaceduel/sprites/explosion/mineex07.pbm b/kspaceduel/sprites/explosion/mineex07.pbm Binary files differnew file mode 100644 index 00000000..cc62a4a8 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex07.pbm diff --git a/kspaceduel/sprites/explosion/mineex07.ppm b/kspaceduel/sprites/explosion/mineex07.ppm Binary files differnew file mode 100644 index 00000000..564ecaea --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex07.ppm diff --git a/kspaceduel/sprites/explosion/mineex08.pbm b/kspaceduel/sprites/explosion/mineex08.pbm Binary files differnew file mode 100644 index 00000000..b3db5320 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex08.pbm diff --git a/kspaceduel/sprites/explosion/mineex08.ppm b/kspaceduel/sprites/explosion/mineex08.ppm Binary files differnew file mode 100644 index 00000000..99f7bfe7 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex08.ppm diff --git a/kspaceduel/sprites/explosion/mineex09.pbm b/kspaceduel/sprites/explosion/mineex09.pbm Binary files differnew file mode 100644 index 00000000..9d2d32f8 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex09.pbm diff --git a/kspaceduel/sprites/explosion/mineex09.ppm b/kspaceduel/sprites/explosion/mineex09.ppm Binary files differnew file mode 100644 index 00000000..b23aec3a --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex09.ppm diff --git a/kspaceduel/sprites/explosion/mineex10.pbm b/kspaceduel/sprites/explosion/mineex10.pbm Binary files differnew file mode 100644 index 00000000..101e5845 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex10.pbm diff --git a/kspaceduel/sprites/explosion/mineex10.ppm b/kspaceduel/sprites/explosion/mineex10.ppm Binary files differnew file mode 100644 index 00000000..e2f23352 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex10.ppm diff --git a/kspaceduel/sprites/explosion/mineex11.pbm b/kspaceduel/sprites/explosion/mineex11.pbm Binary files differnew file mode 100644 index 00000000..40818303 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex11.pbm diff --git a/kspaceduel/sprites/explosion/mineex11.ppm b/kspaceduel/sprites/explosion/mineex11.ppm Binary files differnew file mode 100644 index 00000000..ed38957c --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex11.ppm diff --git a/kspaceduel/sprites/explosion/mineex12.pbm b/kspaceduel/sprites/explosion/mineex12.pbm Binary files differnew file mode 100644 index 00000000..fc7efa9f --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex12.pbm diff --git a/kspaceduel/sprites/explosion/mineex12.ppm b/kspaceduel/sprites/explosion/mineex12.ppm Binary files differnew file mode 100644 index 00000000..1d2b4394 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex12.ppm diff --git a/kspaceduel/sprites/explosion/mineex13.pbm b/kspaceduel/sprites/explosion/mineex13.pbm Binary files differnew file mode 100644 index 00000000..286f2d94 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex13.pbm diff --git a/kspaceduel/sprites/explosion/mineex13.ppm b/kspaceduel/sprites/explosion/mineex13.ppm Binary files differnew file mode 100644 index 00000000..fc2b928e --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex13.ppm diff --git a/kspaceduel/sprites/explosion/mineex14.pbm b/kspaceduel/sprites/explosion/mineex14.pbm Binary files differnew file mode 100644 index 00000000..80f1d799 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex14.pbm diff --git a/kspaceduel/sprites/explosion/mineex14.ppm b/kspaceduel/sprites/explosion/mineex14.ppm Binary files differnew file mode 100644 index 00000000..e674c572 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex14.ppm diff --git a/kspaceduel/sprites/explosion/mineex15.pbm b/kspaceduel/sprites/explosion/mineex15.pbm Binary files differnew file mode 100644 index 00000000..c333dc4c --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex15.pbm diff --git a/kspaceduel/sprites/explosion/mineex15.ppm b/kspaceduel/sprites/explosion/mineex15.ppm Binary files differnew file mode 100644 index 00000000..c0de08db --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex15.ppm diff --git a/kspaceduel/sprites/explosion/mineex16.pbm b/kspaceduel/sprites/explosion/mineex16.pbm Binary files differnew file mode 100644 index 00000000..c333dc4c --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex16.pbm diff --git a/kspaceduel/sprites/explosion/mineex16.ppm b/kspaceduel/sprites/explosion/mineex16.ppm Binary files differnew file mode 100644 index 00000000..c0de08db --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex16.ppm diff --git a/kspaceduel/sprites/explosion/mineex17.pbm b/kspaceduel/sprites/explosion/mineex17.pbm Binary files differnew file mode 100644 index 00000000..cce4495a --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex17.pbm diff --git a/kspaceduel/sprites/explosion/mineex17.ppm b/kspaceduel/sprites/explosion/mineex17.ppm Binary files differnew file mode 100644 index 00000000..7a9e0cc2 --- /dev/null +++ b/kspaceduel/sprites/explosion/mineex17.ppm diff --git a/kspaceduel/sprites/playerinfo/Makefile.am b/kspaceduel/sprites/playerinfo/Makefile.am new file mode 100644 index 00000000..0e3dc6b8 --- /dev/null +++ b/kspaceduel/sprites/playerinfo/Makefile.am @@ -0,0 +1,6 @@ +playerdir = $(kde_datadir)/kspaceduel/sprites/playerinfo +player_DATA = \ +energy.pnm mine.pnm ship10.pnm ship11.pnm ship12.pnm ship13.pnm ship20.pnm \ +ship21.pnm ship22.pnm ship23.pnm win.pnm + +EXTRA_DIST = $(player_DATA) diff --git a/kspaceduel/sprites/playerinfo/energy.pnm b/kspaceduel/sprites/playerinfo/energy.pnm Binary files differnew file mode 100644 index 00000000..7468f3bd --- /dev/null +++ b/kspaceduel/sprites/playerinfo/energy.pnm diff --git a/kspaceduel/sprites/playerinfo/mine.pnm b/kspaceduel/sprites/playerinfo/mine.pnm Binary files differnew file mode 100644 index 00000000..44ff28ef --- /dev/null +++ b/kspaceduel/sprites/playerinfo/mine.pnm diff --git a/kspaceduel/sprites/playerinfo/ship10.pnm b/kspaceduel/sprites/playerinfo/ship10.pnm Binary files differnew file mode 100644 index 00000000..9463990e --- /dev/null +++ b/kspaceduel/sprites/playerinfo/ship10.pnm diff --git a/kspaceduel/sprites/playerinfo/ship11.pnm b/kspaceduel/sprites/playerinfo/ship11.pnm Binary files differnew file mode 100644 index 00000000..66ef5825 --- /dev/null +++ b/kspaceduel/sprites/playerinfo/ship11.pnm diff --git a/kspaceduel/sprites/playerinfo/ship12.pnm b/kspaceduel/sprites/playerinfo/ship12.pnm Binary files differnew file mode 100644 index 00000000..b5dafbd6 --- /dev/null +++ b/kspaceduel/sprites/playerinfo/ship12.pnm diff --git a/kspaceduel/sprites/playerinfo/ship13.pnm b/kspaceduel/sprites/playerinfo/ship13.pnm Binary files differnew file mode 100644 index 00000000..4daf565f --- /dev/null +++ b/kspaceduel/sprites/playerinfo/ship13.pnm diff --git a/kspaceduel/sprites/playerinfo/ship20.pnm b/kspaceduel/sprites/playerinfo/ship20.pnm Binary files differnew file mode 100644 index 00000000..aae88e86 --- /dev/null +++ b/kspaceduel/sprites/playerinfo/ship20.pnm diff --git a/kspaceduel/sprites/playerinfo/ship21.pnm b/kspaceduel/sprites/playerinfo/ship21.pnm Binary files differnew file mode 100644 index 00000000..600e6555 --- /dev/null +++ b/kspaceduel/sprites/playerinfo/ship21.pnm diff --git a/kspaceduel/sprites/playerinfo/ship22.pnm b/kspaceduel/sprites/playerinfo/ship22.pnm Binary files differnew file mode 100644 index 00000000..34a95574 --- /dev/null +++ b/kspaceduel/sprites/playerinfo/ship22.pnm diff --git a/kspaceduel/sprites/playerinfo/ship23.pnm b/kspaceduel/sprites/playerinfo/ship23.pnm Binary files differnew file mode 100644 index 00000000..8487b42a --- /dev/null +++ b/kspaceduel/sprites/playerinfo/ship23.pnm diff --git a/kspaceduel/sprites/playerinfo/win.pnm b/kspaceduel/sprites/playerinfo/win.pnm Binary files differnew file mode 100644 index 00000000..324ba53c --- /dev/null +++ b/kspaceduel/sprites/playerinfo/win.pnm diff --git a/kspaceduel/sprites/powerups/Makefile.am b/kspaceduel/sprites/powerups/Makefile.am new file mode 100644 index 00000000..5133d7d7 --- /dev/null +++ b/kspaceduel/sprites/powerups/Makefile.am @@ -0,0 +1,5 @@ +powerdir = $(kde_datadir)/kspaceduel/sprites/powerups +power_DATA = \ +pbullet.pbm pbullet.ppm penergy.pbm penergy.ppm pmine.pbm pmine.ppm \ +pshield.pbm pshield.ppm +EXTRA_DIST = $(power_DATA) diff --git a/kspaceduel/sprites/powerups/pbullet.pbm b/kspaceduel/sprites/powerups/pbullet.pbm new file mode 100644 index 00000000..f363dd1c --- /dev/null +++ b/kspaceduel/sprites/powerups/pbullet.pbm @@ -0,0 +1,3 @@ +P4 +14 14 +À?ðøÿøÿüÿüÿüÿüÿüÿüÿøø?ðà
\ No newline at end of file diff --git a/kspaceduel/sprites/powerups/pbullet.ppm b/kspaceduel/sprites/powerups/pbullet.ppm Binary files differnew file mode 100644 index 00000000..b66820ec --- /dev/null +++ b/kspaceduel/sprites/powerups/pbullet.ppm diff --git a/kspaceduel/sprites/powerups/penergy.pbm b/kspaceduel/sprites/powerups/penergy.pbm new file mode 100644 index 00000000..f363dd1c --- /dev/null +++ b/kspaceduel/sprites/powerups/penergy.pbm @@ -0,0 +1,3 @@ +P4 +14 14 +À?ðøÿøÿüÿüÿüÿüÿüÿüÿøø?ðà
\ No newline at end of file diff --git a/kspaceduel/sprites/powerups/penergy.ppm b/kspaceduel/sprites/powerups/penergy.ppm Binary files differnew file mode 100644 index 00000000..a2388c28 --- /dev/null +++ b/kspaceduel/sprites/powerups/penergy.ppm diff --git a/kspaceduel/sprites/powerups/pmine.pbm b/kspaceduel/sprites/powerups/pmine.pbm new file mode 100644 index 00000000..f363dd1c --- /dev/null +++ b/kspaceduel/sprites/powerups/pmine.pbm @@ -0,0 +1,3 @@ +P4 +14 14 +À?ðøÿøÿüÿüÿüÿüÿüÿüÿøø?ðà
\ No newline at end of file diff --git a/kspaceduel/sprites/powerups/pmine.ppm b/kspaceduel/sprites/powerups/pmine.ppm Binary files differnew file mode 100644 index 00000000..8be25623 --- /dev/null +++ b/kspaceduel/sprites/powerups/pmine.ppm diff --git a/kspaceduel/sprites/powerups/pshield.pbm b/kspaceduel/sprites/powerups/pshield.pbm new file mode 100644 index 00000000..f363dd1c --- /dev/null +++ b/kspaceduel/sprites/powerups/pshield.pbm @@ -0,0 +1,3 @@ +P4 +14 14 +À?ðøÿøÿüÿüÿüÿüÿüÿüÿøø?ðà
\ No newline at end of file diff --git a/kspaceduel/sprites/powerups/pshield.ppm b/kspaceduel/sprites/powerups/pshield.ppm Binary files differnew file mode 100644 index 00000000..9be24c93 --- /dev/null +++ b/kspaceduel/sprites/powerups/pshield.ppm diff --git a/kspaceduel/sprites/ship1/Makefile.am b/kspaceduel/sprites/ship1/Makefile.am new file mode 100644 index 00000000..aca11c80 --- /dev/null +++ b/kspaceduel/sprites/ship1/Makefile.am @@ -0,0 +1,25 @@ +ship1dir = $(kde_datadir)/kspaceduel/sprites/ship1 +ship1_DATA = \ +bullet.pbm bullet.ppm mine0.pbm mine0.ppm mine1.pbm mine1.ppm ship00.pbm \ +ship00.ppm ship01.pbm ship01.ppm ship02.pbm ship02.ppm ship03.pbm \ +ship03.ppm ship04.pbm ship04.ppm ship05.pbm ship05.ppm ship06.pbm \ +ship06.ppm ship07.pbm ship07.ppm ship08.pbm ship08.ppm ship09.pbm \ +ship09.ppm ship10.pbm ship10.ppm ship11.pbm ship11.ppm ship12.pbm \ +ship12.ppm ship13.pbm ship13.ppm ship14.pbm ship14.ppm ship15.pbm \ +ship15.ppm ship16.pbm ship16.ppm ship17.pbm ship17.ppm ship18.pbm \ +ship18.ppm ship19.pbm ship19.ppm ship20.pbm ship20.ppm ship21.pbm \ +ship21.ppm ship22.pbm ship22.ppm ship23.pbm ship23.ppm ship24.pbm \ +ship24.ppm ship25.pbm ship25.ppm ship26.pbm ship26.ppm ship27.pbm \ +ship27.ppm ship28.pbm ship28.ppm ship29.pbm ship29.ppm ship30.pbm \ +ship30.ppm ship31.pbm ship31.ppm ship32.pbm ship32.ppm ship33.pbm \ +ship33.ppm ship34.pbm ship34.ppm ship35.pbm ship35.ppm ship36.pbm \ +ship36.ppm ship37.pbm ship37.ppm ship38.pbm ship38.ppm ship39.pbm \ +ship39.ppm ship40.pbm ship40.ppm ship41.pbm ship41.ppm ship42.pbm \ +ship42.ppm ship43.pbm ship43.ppm ship44.pbm ship44.ppm ship45.pbm \ +ship45.ppm ship46.pbm ship46.ppm ship47.pbm ship47.ppm ship48.pbm \ +ship48.ppm ship49.pbm ship49.ppm ship50.pbm ship50.ppm ship51.pbm \ +ship51.ppm ship52.pbm ship52.ppm ship53.pbm ship53.ppm ship54.pbm \ +ship54.ppm ship55.pbm ship55.ppm ship56.pbm ship56.ppm ship57.pbm \ +ship57.ppm ship58.pbm ship58.ppm ship59.pbm ship59.ppm ship60.pbm \ +ship60.ppm ship61.pbm ship61.ppm ship62.pbm ship62.ppm ship63.pbm \ +ship63.ppm ship64.pbm ship64.ppm diff --git a/kspaceduel/sprites/ship1/bullet.pbm b/kspaceduel/sprites/ship1/bullet.pbm new file mode 100644 index 00000000..9f8fd80d --- /dev/null +++ b/kspaceduel/sprites/ship1/bullet.pbm @@ -0,0 +1,5 @@ +P1 +3 3 +111 +111 +111 diff --git a/kspaceduel/sprites/ship1/bullet.ppm b/kspaceduel/sprites/ship1/bullet.ppm new file mode 100644 index 00000000..56a1b85a --- /dev/null +++ b/kspaceduel/sprites/ship1/bullet.ppm @@ -0,0 +1,5 @@ +P6 +# HOTSPOT 1 1 +3 3 +255 +n""±""n""±""î""""n""""n""
\ No newline at end of file diff --git a/kspaceduel/sprites/ship1/mine0.pbm b/kspaceduel/sprites/ship1/mine0.pbm Binary files differnew file mode 100644 index 00000000..158c3baf --- /dev/null +++ b/kspaceduel/sprites/ship1/mine0.pbm diff --git a/kspaceduel/sprites/ship1/mine0.ppm b/kspaceduel/sprites/ship1/mine0.ppm Binary files differnew file mode 100644 index 00000000..94371392 --- /dev/null +++ b/kspaceduel/sprites/ship1/mine0.ppm diff --git a/kspaceduel/sprites/ship1/mine1.pbm b/kspaceduel/sprites/ship1/mine1.pbm Binary files differnew file mode 100644 index 00000000..0b39d79e --- /dev/null +++ b/kspaceduel/sprites/ship1/mine1.pbm diff --git a/kspaceduel/sprites/ship1/mine1.ppm b/kspaceduel/sprites/ship1/mine1.ppm Binary files differnew file mode 100644 index 00000000..1ae3374e --- /dev/null +++ b/kspaceduel/sprites/ship1/mine1.ppm diff --git a/kspaceduel/sprites/ship1/ship00.pbm b/kspaceduel/sprites/ship1/ship00.pbm Binary files differnew file mode 100644 index 00000000..6bf23756 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship00.pbm diff --git a/kspaceduel/sprites/ship1/ship00.ppm b/kspaceduel/sprites/ship1/ship00.ppm Binary files differnew file mode 100644 index 00000000..c55557a7 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship00.ppm diff --git a/kspaceduel/sprites/ship1/ship01.pbm b/kspaceduel/sprites/ship1/ship01.pbm Binary files differnew file mode 100644 index 00000000..d1f5d378 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship01.pbm diff --git a/kspaceduel/sprites/ship1/ship01.ppm b/kspaceduel/sprites/ship1/ship01.ppm Binary files differnew file mode 100644 index 00000000..e47c4504 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship01.ppm diff --git a/kspaceduel/sprites/ship1/ship02.pbm b/kspaceduel/sprites/ship1/ship02.pbm Binary files differnew file mode 100644 index 00000000..4f0dcafe --- /dev/null +++ b/kspaceduel/sprites/ship1/ship02.pbm diff --git a/kspaceduel/sprites/ship1/ship02.ppm b/kspaceduel/sprites/ship1/ship02.ppm Binary files differnew file mode 100644 index 00000000..8077b010 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship02.ppm diff --git a/kspaceduel/sprites/ship1/ship03.pbm b/kspaceduel/sprites/ship1/ship03.pbm Binary files differnew file mode 100644 index 00000000..8096630c --- /dev/null +++ b/kspaceduel/sprites/ship1/ship03.pbm diff --git a/kspaceduel/sprites/ship1/ship03.ppm b/kspaceduel/sprites/ship1/ship03.ppm Binary files differnew file mode 100644 index 00000000..706a8ece --- /dev/null +++ b/kspaceduel/sprites/ship1/ship03.ppm diff --git a/kspaceduel/sprites/ship1/ship04.pbm b/kspaceduel/sprites/ship1/ship04.pbm Binary files differnew file mode 100644 index 00000000..7d43a13e --- /dev/null +++ b/kspaceduel/sprites/ship1/ship04.pbm diff --git a/kspaceduel/sprites/ship1/ship04.ppm b/kspaceduel/sprites/ship1/ship04.ppm Binary files differnew file mode 100644 index 00000000..0d3fc821 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship04.ppm diff --git a/kspaceduel/sprites/ship1/ship05.pbm b/kspaceduel/sprites/ship1/ship05.pbm Binary files differnew file mode 100644 index 00000000..22d41bf2 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship05.pbm diff --git a/kspaceduel/sprites/ship1/ship05.ppm b/kspaceduel/sprites/ship1/ship05.ppm Binary files differnew file mode 100644 index 00000000..af2541cf --- /dev/null +++ b/kspaceduel/sprites/ship1/ship05.ppm diff --git a/kspaceduel/sprites/ship1/ship06.pbm b/kspaceduel/sprites/ship1/ship06.pbm Binary files differnew file mode 100644 index 00000000..d4c43aa1 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship06.pbm diff --git a/kspaceduel/sprites/ship1/ship06.ppm b/kspaceduel/sprites/ship1/ship06.ppm Binary files differnew file mode 100644 index 00000000..e41b0a43 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship06.ppm diff --git a/kspaceduel/sprites/ship1/ship07.pbm b/kspaceduel/sprites/ship1/ship07.pbm Binary files differnew file mode 100644 index 00000000..7f3e2683 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship07.pbm diff --git a/kspaceduel/sprites/ship1/ship07.ppm b/kspaceduel/sprites/ship1/ship07.ppm Binary files differnew file mode 100644 index 00000000..bf016f6c --- /dev/null +++ b/kspaceduel/sprites/ship1/ship07.ppm diff --git a/kspaceduel/sprites/ship1/ship08.pbm b/kspaceduel/sprites/ship1/ship08.pbm Binary files differnew file mode 100644 index 00000000..9cfd6bf1 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship08.pbm diff --git a/kspaceduel/sprites/ship1/ship08.ppm b/kspaceduel/sprites/ship1/ship08.ppm Binary files differnew file mode 100644 index 00000000..5939bda6 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship08.ppm diff --git a/kspaceduel/sprites/ship1/ship09.pbm b/kspaceduel/sprites/ship1/ship09.pbm Binary files differnew file mode 100644 index 00000000..6ec3a907 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship09.pbm diff --git a/kspaceduel/sprites/ship1/ship09.ppm b/kspaceduel/sprites/ship1/ship09.ppm Binary files differnew file mode 100644 index 00000000..9e94fa33 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship09.ppm diff --git a/kspaceduel/sprites/ship1/ship10.pbm b/kspaceduel/sprites/ship1/ship10.pbm Binary files differnew file mode 100644 index 00000000..4cd96f5d --- /dev/null +++ b/kspaceduel/sprites/ship1/ship10.pbm diff --git a/kspaceduel/sprites/ship1/ship10.ppm b/kspaceduel/sprites/ship1/ship10.ppm Binary files differnew file mode 100644 index 00000000..0cbf08f9 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship10.ppm diff --git a/kspaceduel/sprites/ship1/ship11.pbm b/kspaceduel/sprites/ship1/ship11.pbm Binary files differnew file mode 100644 index 00000000..37dd4050 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship11.pbm diff --git a/kspaceduel/sprites/ship1/ship11.ppm b/kspaceduel/sprites/ship1/ship11.ppm Binary files differnew file mode 100644 index 00000000..1b383d50 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship11.ppm diff --git a/kspaceduel/sprites/ship1/ship12.pbm b/kspaceduel/sprites/ship1/ship12.pbm Binary files differnew file mode 100644 index 00000000..c0ba451b --- /dev/null +++ b/kspaceduel/sprites/ship1/ship12.pbm diff --git a/kspaceduel/sprites/ship1/ship12.ppm b/kspaceduel/sprites/ship1/ship12.ppm Binary files differnew file mode 100644 index 00000000..79dd1087 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship12.ppm diff --git a/kspaceduel/sprites/ship1/ship13.pbm b/kspaceduel/sprites/ship1/ship13.pbm Binary files differnew file mode 100644 index 00000000..585dd0a0 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship13.pbm diff --git a/kspaceduel/sprites/ship1/ship13.ppm b/kspaceduel/sprites/ship1/ship13.ppm Binary files differnew file mode 100644 index 00000000..af962f8d --- /dev/null +++ b/kspaceduel/sprites/ship1/ship13.ppm diff --git a/kspaceduel/sprites/ship1/ship14.pbm b/kspaceduel/sprites/ship1/ship14.pbm Binary files differnew file mode 100644 index 00000000..aaf4bf9e --- /dev/null +++ b/kspaceduel/sprites/ship1/ship14.pbm diff --git a/kspaceduel/sprites/ship1/ship14.ppm b/kspaceduel/sprites/ship1/ship14.ppm Binary files differnew file mode 100644 index 00000000..886b6be9 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship14.ppm diff --git a/kspaceduel/sprites/ship1/ship15.pbm b/kspaceduel/sprites/ship1/ship15.pbm Binary files differnew file mode 100644 index 00000000..d61306e9 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship15.pbm diff --git a/kspaceduel/sprites/ship1/ship15.ppm b/kspaceduel/sprites/ship1/ship15.ppm Binary files differnew file mode 100644 index 00000000..e7f8f7e2 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship15.ppm diff --git a/kspaceduel/sprites/ship1/ship16.pbm b/kspaceduel/sprites/ship1/ship16.pbm Binary files differnew file mode 100644 index 00000000..47125d73 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship16.pbm diff --git a/kspaceduel/sprites/ship1/ship16.ppm b/kspaceduel/sprites/ship1/ship16.ppm Binary files differnew file mode 100644 index 00000000..228cf12c --- /dev/null +++ b/kspaceduel/sprites/ship1/ship16.ppm diff --git a/kspaceduel/sprites/ship1/ship17.pbm b/kspaceduel/sprites/ship1/ship17.pbm Binary files differnew file mode 100644 index 00000000..31828cbd --- /dev/null +++ b/kspaceduel/sprites/ship1/ship17.pbm diff --git a/kspaceduel/sprites/ship1/ship17.ppm b/kspaceduel/sprites/ship1/ship17.ppm Binary files differnew file mode 100644 index 00000000..4dff9f7b --- /dev/null +++ b/kspaceduel/sprites/ship1/ship17.ppm diff --git a/kspaceduel/sprites/ship1/ship18.pbm b/kspaceduel/sprites/ship1/ship18.pbm Binary files differnew file mode 100644 index 00000000..a104102d --- /dev/null +++ b/kspaceduel/sprites/ship1/ship18.pbm diff --git a/kspaceduel/sprites/ship1/ship18.ppm b/kspaceduel/sprites/ship1/ship18.ppm Binary files differnew file mode 100644 index 00000000..91828c52 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship18.ppm diff --git a/kspaceduel/sprites/ship1/ship19.pbm b/kspaceduel/sprites/ship1/ship19.pbm Binary files differnew file mode 100644 index 00000000..d4184744 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship19.pbm diff --git a/kspaceduel/sprites/ship1/ship19.ppm b/kspaceduel/sprites/ship1/ship19.ppm Binary files differnew file mode 100644 index 00000000..1e44c1fa --- /dev/null +++ b/kspaceduel/sprites/ship1/ship19.ppm diff --git a/kspaceduel/sprites/ship1/ship20.pbm b/kspaceduel/sprites/ship1/ship20.pbm Binary files differnew file mode 100644 index 00000000..c9e6592a --- /dev/null +++ b/kspaceduel/sprites/ship1/ship20.pbm diff --git a/kspaceduel/sprites/ship1/ship20.ppm b/kspaceduel/sprites/ship1/ship20.ppm Binary files differnew file mode 100644 index 00000000..b13956eb --- /dev/null +++ b/kspaceduel/sprites/ship1/ship20.ppm diff --git a/kspaceduel/sprites/ship1/ship21.pbm b/kspaceduel/sprites/ship1/ship21.pbm Binary files differnew file mode 100644 index 00000000..dc8a04fc --- /dev/null +++ b/kspaceduel/sprites/ship1/ship21.pbm diff --git a/kspaceduel/sprites/ship1/ship21.ppm b/kspaceduel/sprites/ship1/ship21.ppm Binary files differnew file mode 100644 index 00000000..d2a51f6d --- /dev/null +++ b/kspaceduel/sprites/ship1/ship21.ppm diff --git a/kspaceduel/sprites/ship1/ship22.pbm b/kspaceduel/sprites/ship1/ship22.pbm Binary files differnew file mode 100644 index 00000000..0675c265 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship22.pbm diff --git a/kspaceduel/sprites/ship1/ship22.ppm b/kspaceduel/sprites/ship1/ship22.ppm Binary files differnew file mode 100644 index 00000000..1471eb41 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship22.ppm diff --git a/kspaceduel/sprites/ship1/ship23.pbm b/kspaceduel/sprites/ship1/ship23.pbm Binary files differnew file mode 100644 index 00000000..0ff6d171 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship23.pbm diff --git a/kspaceduel/sprites/ship1/ship23.ppm b/kspaceduel/sprites/ship1/ship23.ppm Binary files differnew file mode 100644 index 00000000..008adf46 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship23.ppm diff --git a/kspaceduel/sprites/ship1/ship24.pbm b/kspaceduel/sprites/ship1/ship24.pbm Binary files differnew file mode 100644 index 00000000..613500ab --- /dev/null +++ b/kspaceduel/sprites/ship1/ship24.pbm diff --git a/kspaceduel/sprites/ship1/ship24.ppm b/kspaceduel/sprites/ship1/ship24.ppm Binary files differnew file mode 100644 index 00000000..e96306e9 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship24.ppm diff --git a/kspaceduel/sprites/ship1/ship25.pbm b/kspaceduel/sprites/ship1/ship25.pbm Binary files differnew file mode 100644 index 00000000..857db7c3 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship25.pbm diff --git a/kspaceduel/sprites/ship1/ship25.ppm b/kspaceduel/sprites/ship1/ship25.ppm Binary files differnew file mode 100644 index 00000000..4cbae30e --- /dev/null +++ b/kspaceduel/sprites/ship1/ship25.ppm diff --git a/kspaceduel/sprites/ship1/ship26.pbm b/kspaceduel/sprites/ship1/ship26.pbm Binary files differnew file mode 100644 index 00000000..adbc4f54 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship26.pbm diff --git a/kspaceduel/sprites/ship1/ship26.ppm b/kspaceduel/sprites/ship1/ship26.ppm Binary files differnew file mode 100644 index 00000000..3bc7bbb0 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship26.ppm diff --git a/kspaceduel/sprites/ship1/ship27.pbm b/kspaceduel/sprites/ship1/ship27.pbm Binary files differnew file mode 100644 index 00000000..d2a19254 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship27.pbm diff --git a/kspaceduel/sprites/ship1/ship27.ppm b/kspaceduel/sprites/ship1/ship27.ppm Binary files differnew file mode 100644 index 00000000..e92fae28 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship27.ppm diff --git a/kspaceduel/sprites/ship1/ship28.pbm b/kspaceduel/sprites/ship1/ship28.pbm Binary files differnew file mode 100644 index 00000000..f2274e62 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship28.pbm diff --git a/kspaceduel/sprites/ship1/ship28.ppm b/kspaceduel/sprites/ship1/ship28.ppm Binary files differnew file mode 100644 index 00000000..38137308 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship28.ppm diff --git a/kspaceduel/sprites/ship1/ship29.pbm b/kspaceduel/sprites/ship1/ship29.pbm Binary files differnew file mode 100644 index 00000000..2d48307f --- /dev/null +++ b/kspaceduel/sprites/ship1/ship29.pbm diff --git a/kspaceduel/sprites/ship1/ship29.ppm b/kspaceduel/sprites/ship1/ship29.ppm Binary files differnew file mode 100644 index 00000000..92dc7048 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship29.ppm diff --git a/kspaceduel/sprites/ship1/ship30.pbm b/kspaceduel/sprites/ship1/ship30.pbm Binary files differnew file mode 100644 index 00000000..85cf7861 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship30.pbm diff --git a/kspaceduel/sprites/ship1/ship30.ppm b/kspaceduel/sprites/ship1/ship30.ppm Binary files differnew file mode 100644 index 00000000..1e34a615 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship30.ppm diff --git a/kspaceduel/sprites/ship1/ship31.pbm b/kspaceduel/sprites/ship1/ship31.pbm Binary files differnew file mode 100644 index 00000000..0a6a2f98 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship31.pbm diff --git a/kspaceduel/sprites/ship1/ship31.ppm b/kspaceduel/sprites/ship1/ship31.ppm Binary files differnew file mode 100644 index 00000000..88de98ce --- /dev/null +++ b/kspaceduel/sprites/ship1/ship31.ppm diff --git a/kspaceduel/sprites/ship1/ship32.pbm b/kspaceduel/sprites/ship1/ship32.pbm Binary files differnew file mode 100644 index 00000000..da818895 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship32.pbm diff --git a/kspaceduel/sprites/ship1/ship32.ppm b/kspaceduel/sprites/ship1/ship32.ppm Binary files differnew file mode 100644 index 00000000..dd0ece74 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship32.ppm diff --git a/kspaceduel/sprites/ship1/ship33.pbm b/kspaceduel/sprites/ship1/ship33.pbm Binary files differnew file mode 100644 index 00000000..fe24c29b --- /dev/null +++ b/kspaceduel/sprites/ship1/ship33.pbm diff --git a/kspaceduel/sprites/ship1/ship33.ppm b/kspaceduel/sprites/ship1/ship33.ppm Binary files differnew file mode 100644 index 00000000..24c47275 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship33.ppm diff --git a/kspaceduel/sprites/ship1/ship34.pbm b/kspaceduel/sprites/ship1/ship34.pbm Binary files differnew file mode 100644 index 00000000..25e1f1d2 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship34.pbm diff --git a/kspaceduel/sprites/ship1/ship34.ppm b/kspaceduel/sprites/ship1/ship34.ppm Binary files differnew file mode 100644 index 00000000..4509b69b --- /dev/null +++ b/kspaceduel/sprites/ship1/ship34.ppm diff --git a/kspaceduel/sprites/ship1/ship35.pbm b/kspaceduel/sprites/ship1/ship35.pbm Binary files differnew file mode 100644 index 00000000..a832dafe --- /dev/null +++ b/kspaceduel/sprites/ship1/ship35.pbm diff --git a/kspaceduel/sprites/ship1/ship35.ppm b/kspaceduel/sprites/ship1/ship35.ppm Binary files differnew file mode 100644 index 00000000..084eafa0 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship35.ppm diff --git a/kspaceduel/sprites/ship1/ship36.pbm b/kspaceduel/sprites/ship1/ship36.pbm Binary files differnew file mode 100644 index 00000000..08a3295a --- /dev/null +++ b/kspaceduel/sprites/ship1/ship36.pbm diff --git a/kspaceduel/sprites/ship1/ship36.ppm b/kspaceduel/sprites/ship1/ship36.ppm Binary files differnew file mode 100644 index 00000000..b97b6391 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship36.ppm diff --git a/kspaceduel/sprites/ship1/ship37.pbm b/kspaceduel/sprites/ship1/ship37.pbm Binary files differnew file mode 100644 index 00000000..2727c02d --- /dev/null +++ b/kspaceduel/sprites/ship1/ship37.pbm diff --git a/kspaceduel/sprites/ship1/ship37.ppm b/kspaceduel/sprites/ship1/ship37.ppm Binary files differnew file mode 100644 index 00000000..4b1fa725 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship37.ppm diff --git a/kspaceduel/sprites/ship1/ship38.pbm b/kspaceduel/sprites/ship1/ship38.pbm Binary files differnew file mode 100644 index 00000000..87b51c80 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship38.pbm diff --git a/kspaceduel/sprites/ship1/ship38.ppm b/kspaceduel/sprites/ship1/ship38.ppm Binary files differnew file mode 100644 index 00000000..44bf768a --- /dev/null +++ b/kspaceduel/sprites/ship1/ship38.ppm diff --git a/kspaceduel/sprites/ship1/ship39.pbm b/kspaceduel/sprites/ship1/ship39.pbm Binary files differnew file mode 100644 index 00000000..99281fff --- /dev/null +++ b/kspaceduel/sprites/ship1/ship39.pbm diff --git a/kspaceduel/sprites/ship1/ship39.ppm b/kspaceduel/sprites/ship1/ship39.ppm Binary files differnew file mode 100644 index 00000000..ffafc076 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship39.ppm diff --git a/kspaceduel/sprites/ship1/ship40.pbm b/kspaceduel/sprites/ship1/ship40.pbm Binary files differnew file mode 100644 index 00000000..eb4203ed --- /dev/null +++ b/kspaceduel/sprites/ship1/ship40.pbm diff --git a/kspaceduel/sprites/ship1/ship40.ppm b/kspaceduel/sprites/ship1/ship40.ppm Binary files differnew file mode 100644 index 00000000..1def4c91 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship40.ppm diff --git a/kspaceduel/sprites/ship1/ship41.pbm b/kspaceduel/sprites/ship1/ship41.pbm Binary files differnew file mode 100644 index 00000000..61782784 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship41.pbm diff --git a/kspaceduel/sprites/ship1/ship41.ppm b/kspaceduel/sprites/ship1/ship41.ppm Binary files differnew file mode 100644 index 00000000..02d26e8c --- /dev/null +++ b/kspaceduel/sprites/ship1/ship41.ppm diff --git a/kspaceduel/sprites/ship1/ship42.pbm b/kspaceduel/sprites/ship1/ship42.pbm Binary files differnew file mode 100644 index 00000000..b98fabd1 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship42.pbm diff --git a/kspaceduel/sprites/ship1/ship42.ppm b/kspaceduel/sprites/ship1/ship42.ppm Binary files differnew file mode 100644 index 00000000..4c2f8b1a --- /dev/null +++ b/kspaceduel/sprites/ship1/ship42.ppm diff --git a/kspaceduel/sprites/ship1/ship43.pbm b/kspaceduel/sprites/ship1/ship43.pbm Binary files differnew file mode 100644 index 00000000..adc24118 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship43.pbm diff --git a/kspaceduel/sprites/ship1/ship43.ppm b/kspaceduel/sprites/ship1/ship43.ppm Binary files differnew file mode 100644 index 00000000..7a8da650 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship43.ppm diff --git a/kspaceduel/sprites/ship1/ship44.pbm b/kspaceduel/sprites/ship1/ship44.pbm Binary files differnew file mode 100644 index 00000000..0b8afcd9 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship44.pbm diff --git a/kspaceduel/sprites/ship1/ship44.ppm b/kspaceduel/sprites/ship1/ship44.ppm Binary files differnew file mode 100644 index 00000000..75c52fc3 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship44.ppm diff --git a/kspaceduel/sprites/ship1/ship45.pbm b/kspaceduel/sprites/ship1/ship45.pbm Binary files differnew file mode 100644 index 00000000..216d22a5 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship45.pbm diff --git a/kspaceduel/sprites/ship1/ship45.ppm b/kspaceduel/sprites/ship1/ship45.ppm Binary files differnew file mode 100644 index 00000000..f75d6322 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship45.ppm diff --git a/kspaceduel/sprites/ship1/ship46.pbm b/kspaceduel/sprites/ship1/ship46.pbm Binary files differnew file mode 100644 index 00000000..7a249684 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship46.pbm diff --git a/kspaceduel/sprites/ship1/ship46.ppm b/kspaceduel/sprites/ship1/ship46.ppm Binary files differnew file mode 100644 index 00000000..a23a8be9 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship46.ppm diff --git a/kspaceduel/sprites/ship1/ship47.pbm b/kspaceduel/sprites/ship1/ship47.pbm Binary files differnew file mode 100644 index 00000000..b5b60231 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship47.pbm diff --git a/kspaceduel/sprites/ship1/ship47.ppm b/kspaceduel/sprites/ship1/ship47.ppm Binary files differnew file mode 100644 index 00000000..3bda3af2 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship47.ppm diff --git a/kspaceduel/sprites/ship1/ship48.pbm b/kspaceduel/sprites/ship1/ship48.pbm Binary files differnew file mode 100644 index 00000000..b396376a --- /dev/null +++ b/kspaceduel/sprites/ship1/ship48.pbm diff --git a/kspaceduel/sprites/ship1/ship48.ppm b/kspaceduel/sprites/ship1/ship48.ppm Binary files differnew file mode 100644 index 00000000..e869d7dc --- /dev/null +++ b/kspaceduel/sprites/ship1/ship48.ppm diff --git a/kspaceduel/sprites/ship1/ship49.pbm b/kspaceduel/sprites/ship1/ship49.pbm Binary files differnew file mode 100644 index 00000000..4e40825c --- /dev/null +++ b/kspaceduel/sprites/ship1/ship49.pbm diff --git a/kspaceduel/sprites/ship1/ship49.ppm b/kspaceduel/sprites/ship1/ship49.ppm Binary files differnew file mode 100644 index 00000000..872c9be2 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship49.ppm diff --git a/kspaceduel/sprites/ship1/ship50.pbm b/kspaceduel/sprites/ship1/ship50.pbm Binary files differnew file mode 100644 index 00000000..72a4e31b --- /dev/null +++ b/kspaceduel/sprites/ship1/ship50.pbm diff --git a/kspaceduel/sprites/ship1/ship50.ppm b/kspaceduel/sprites/ship1/ship50.ppm Binary files differnew file mode 100644 index 00000000..6358387b --- /dev/null +++ b/kspaceduel/sprites/ship1/ship50.ppm diff --git a/kspaceduel/sprites/ship1/ship51.pbm b/kspaceduel/sprites/ship1/ship51.pbm Binary files differnew file mode 100644 index 00000000..6e1b27b3 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship51.pbm diff --git a/kspaceduel/sprites/ship1/ship51.ppm b/kspaceduel/sprites/ship1/ship51.ppm Binary files differnew file mode 100644 index 00000000..fb37a73e --- /dev/null +++ b/kspaceduel/sprites/ship1/ship51.ppm diff --git a/kspaceduel/sprites/ship1/ship52.pbm b/kspaceduel/sprites/ship1/ship52.pbm Binary files differnew file mode 100644 index 00000000..824eec39 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship52.pbm diff --git a/kspaceduel/sprites/ship1/ship52.ppm b/kspaceduel/sprites/ship1/ship52.ppm Binary files differnew file mode 100644 index 00000000..a044f6d6 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship52.ppm diff --git a/kspaceduel/sprites/ship1/ship53.pbm b/kspaceduel/sprites/ship1/ship53.pbm Binary files differnew file mode 100644 index 00000000..3fbc9832 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship53.pbm diff --git a/kspaceduel/sprites/ship1/ship53.ppm b/kspaceduel/sprites/ship1/ship53.ppm Binary files differnew file mode 100644 index 00000000..89f11b55 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship53.ppm diff --git a/kspaceduel/sprites/ship1/ship54.pbm b/kspaceduel/sprites/ship1/ship54.pbm Binary files differnew file mode 100644 index 00000000..97010f8d --- /dev/null +++ b/kspaceduel/sprites/ship1/ship54.pbm diff --git a/kspaceduel/sprites/ship1/ship54.ppm b/kspaceduel/sprites/ship1/ship54.ppm Binary files differnew file mode 100644 index 00000000..2e386eb8 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship54.ppm diff --git a/kspaceduel/sprites/ship1/ship55.pbm b/kspaceduel/sprites/ship1/ship55.pbm Binary files differnew file mode 100644 index 00000000..e2391283 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship55.pbm diff --git a/kspaceduel/sprites/ship1/ship55.ppm b/kspaceduel/sprites/ship1/ship55.ppm Binary files differnew file mode 100644 index 00000000..ee02a506 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship55.ppm diff --git a/kspaceduel/sprites/ship1/ship56.pbm b/kspaceduel/sprites/ship1/ship56.pbm Binary files differnew file mode 100644 index 00000000..c5953877 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship56.pbm diff --git a/kspaceduel/sprites/ship1/ship56.ppm b/kspaceduel/sprites/ship1/ship56.ppm Binary files differnew file mode 100644 index 00000000..38753fc8 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship56.ppm diff --git a/kspaceduel/sprites/ship1/ship57.pbm b/kspaceduel/sprites/ship1/ship57.pbm Binary files differnew file mode 100644 index 00000000..22bfacba --- /dev/null +++ b/kspaceduel/sprites/ship1/ship57.pbm diff --git a/kspaceduel/sprites/ship1/ship57.ppm b/kspaceduel/sprites/ship1/ship57.ppm Binary files differnew file mode 100644 index 00000000..1aaa1905 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship57.ppm diff --git a/kspaceduel/sprites/ship1/ship58.pbm b/kspaceduel/sprites/ship1/ship58.pbm Binary files differnew file mode 100644 index 00000000..4d9f0de3 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship58.pbm diff --git a/kspaceduel/sprites/ship1/ship58.ppm b/kspaceduel/sprites/ship1/ship58.ppm Binary files differnew file mode 100644 index 00000000..e1402352 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship58.ppm diff --git a/kspaceduel/sprites/ship1/ship59.pbm b/kspaceduel/sprites/ship1/ship59.pbm Binary files differnew file mode 100644 index 00000000..c5886207 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship59.pbm diff --git a/kspaceduel/sprites/ship1/ship59.ppm b/kspaceduel/sprites/ship1/ship59.ppm Binary files differnew file mode 100644 index 00000000..fb2a0d6b --- /dev/null +++ b/kspaceduel/sprites/ship1/ship59.ppm diff --git a/kspaceduel/sprites/ship1/ship60.pbm b/kspaceduel/sprites/ship1/ship60.pbm Binary files differnew file mode 100644 index 00000000..3edabddd --- /dev/null +++ b/kspaceduel/sprites/ship1/ship60.pbm diff --git a/kspaceduel/sprites/ship1/ship60.ppm b/kspaceduel/sprites/ship1/ship60.ppm Binary files differnew file mode 100644 index 00000000..e7655dfe --- /dev/null +++ b/kspaceduel/sprites/ship1/ship60.ppm diff --git a/kspaceduel/sprites/ship1/ship61.pbm b/kspaceduel/sprites/ship1/ship61.pbm Binary files differnew file mode 100644 index 00000000..78557a20 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship61.pbm diff --git a/kspaceduel/sprites/ship1/ship61.ppm b/kspaceduel/sprites/ship1/ship61.ppm Binary files differnew file mode 100644 index 00000000..026a618f --- /dev/null +++ b/kspaceduel/sprites/ship1/ship61.ppm diff --git a/kspaceduel/sprites/ship1/ship62.pbm b/kspaceduel/sprites/ship1/ship62.pbm Binary files differnew file mode 100644 index 00000000..bf3495cf --- /dev/null +++ b/kspaceduel/sprites/ship1/ship62.pbm diff --git a/kspaceduel/sprites/ship1/ship62.ppm b/kspaceduel/sprites/ship1/ship62.ppm Binary files differnew file mode 100644 index 00000000..48ca2897 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship62.ppm diff --git a/kspaceduel/sprites/ship1/ship63.pbm b/kspaceduel/sprites/ship1/ship63.pbm Binary files differnew file mode 100644 index 00000000..5ed04c90 --- /dev/null +++ b/kspaceduel/sprites/ship1/ship63.pbm diff --git a/kspaceduel/sprites/ship1/ship63.ppm b/kspaceduel/sprites/ship1/ship63.ppm Binary files differnew file mode 100644 index 00000000..b1d0841b --- /dev/null +++ b/kspaceduel/sprites/ship1/ship63.ppm diff --git a/kspaceduel/sprites/ship1/ship64.pbm b/kspaceduel/sprites/ship1/ship64.pbm Binary files differnew file mode 100644 index 00000000..e37c6fcf --- /dev/null +++ b/kspaceduel/sprites/ship1/ship64.pbm diff --git a/kspaceduel/sprites/ship1/ship64.ppm b/kspaceduel/sprites/ship1/ship64.ppm Binary files differnew file mode 100644 index 00000000..127a50be --- /dev/null +++ b/kspaceduel/sprites/ship1/ship64.ppm diff --git a/kspaceduel/sprites/ship2/Makefile.am b/kspaceduel/sprites/ship2/Makefile.am new file mode 100644 index 00000000..bd201dcb --- /dev/null +++ b/kspaceduel/sprites/ship2/Makefile.am @@ -0,0 +1,27 @@ +ship2dir = $(kde_datadir)/kspaceduel/sprites/ship2 +ship2_DATA = \ +bullet.pbm bullet.ppm mine0.pbm mine0.ppm mine1.pbm mine1.ppm ship00.pbm \ +ship00.ppm ship01.pbm ship01.ppm ship02.pbm ship02.ppm ship03.pbm \ +ship03.ppm ship04.pbm ship04.ppm ship05.pbm ship05.ppm ship06.pbm \ +ship06.ppm ship07.pbm ship07.ppm ship08.pbm ship08.ppm ship09.pbm \ +ship09.ppm ship10.pbm ship10.ppm ship11.pbm ship11.ppm ship12.pbm \ +ship12.ppm ship13.pbm ship13.ppm ship14.pbm ship14.ppm ship15.pbm \ +ship15.ppm ship16.pbm ship16.ppm ship17.pbm ship17.ppm ship18.pbm \ +ship18.ppm ship19.pbm ship19.ppm ship20.pbm ship20.ppm ship21.pbm \ +ship21.ppm ship22.pbm ship22.ppm ship23.pbm ship23.ppm ship24.pbm \ +ship24.ppm ship25.pbm ship25.ppm ship26.pbm ship26.ppm ship27.pbm \ +ship27.ppm ship28.pbm ship28.ppm ship29.pbm ship29.ppm ship30.pbm \ +ship30.ppm ship31.pbm ship31.ppm ship32.pbm ship32.ppm ship33.pbm \ +ship33.ppm ship34.pbm ship34.ppm ship35.pbm ship35.ppm ship36.pbm \ +ship36.ppm ship37.pbm ship37.ppm ship38.pbm ship38.ppm ship39.pbm \ +ship39.ppm ship40.pbm ship40.ppm ship41.pbm ship41.ppm ship42.pbm \ +ship42.ppm ship43.pbm ship43.ppm ship44.pbm ship44.ppm ship45.pbm \ +ship45.ppm ship46.pbm ship46.ppm ship47.pbm ship47.ppm ship48.pbm \ +ship48.ppm ship49.pbm ship49.ppm ship50.pbm ship50.ppm ship51.pbm \ +ship51.ppm ship52.pbm ship52.ppm ship53.pbm ship53.ppm ship54.pbm \ +ship54.ppm ship55.pbm ship55.ppm ship56.pbm ship56.ppm ship57.pbm \ +ship57.ppm ship58.pbm ship58.ppm ship59.pbm ship59.ppm ship60.pbm \ +ship60.ppm ship61.pbm ship61.ppm ship62.pbm ship62.ppm ship63.pbm \ +ship63.ppm ship64.pbm ship64.ppm + +EXTRA_DIST = $(ship2_DATA) diff --git a/kspaceduel/sprites/ship2/bullet.pbm b/kspaceduel/sprites/ship2/bullet.pbm new file mode 100644 index 00000000..9f8fd80d --- /dev/null +++ b/kspaceduel/sprites/ship2/bullet.pbm @@ -0,0 +1,5 @@ +P1 +3 3 +111 +111 +111 diff --git a/kspaceduel/sprites/ship2/bullet.ppm b/kspaceduel/sprites/ship2/bullet.ppm new file mode 100644 index 00000000..33d6d702 --- /dev/null +++ b/kspaceduel/sprites/ship2/bullet.ppm @@ -0,0 +1,5 @@ +P6 +# HOTSPOT 1 1 +3 3 +255 +::–Y_¸::–Y_¸~~ÿY_¸::–Y_¸::–
\ No newline at end of file diff --git a/kspaceduel/sprites/ship2/mine0.pbm b/kspaceduel/sprites/ship2/mine0.pbm Binary files differnew file mode 100644 index 00000000..b9f2a2de --- /dev/null +++ b/kspaceduel/sprites/ship2/mine0.pbm diff --git a/kspaceduel/sprites/ship2/mine0.ppm b/kspaceduel/sprites/ship2/mine0.ppm Binary files differnew file mode 100644 index 00000000..85143cce --- /dev/null +++ b/kspaceduel/sprites/ship2/mine0.ppm diff --git a/kspaceduel/sprites/ship2/mine1.pbm b/kspaceduel/sprites/ship2/mine1.pbm Binary files differnew file mode 100644 index 00000000..21a31590 --- /dev/null +++ b/kspaceduel/sprites/ship2/mine1.pbm diff --git a/kspaceduel/sprites/ship2/mine1.ppm b/kspaceduel/sprites/ship2/mine1.ppm Binary files differnew file mode 100644 index 00000000..12e725d1 --- /dev/null +++ b/kspaceduel/sprites/ship2/mine1.ppm diff --git a/kspaceduel/sprites/ship2/ship00.pbm b/kspaceduel/sprites/ship2/ship00.pbm Binary files differnew file mode 100644 index 00000000..a2c22134 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship00.pbm diff --git a/kspaceduel/sprites/ship2/ship00.ppm b/kspaceduel/sprites/ship2/ship00.ppm Binary files differnew file mode 100644 index 00000000..31e9924c --- /dev/null +++ b/kspaceduel/sprites/ship2/ship00.ppm diff --git a/kspaceduel/sprites/ship2/ship01.pbm b/kspaceduel/sprites/ship2/ship01.pbm Binary files differnew file mode 100644 index 00000000..bc9521af --- /dev/null +++ b/kspaceduel/sprites/ship2/ship01.pbm diff --git a/kspaceduel/sprites/ship2/ship01.ppm b/kspaceduel/sprites/ship2/ship01.ppm Binary files differnew file mode 100644 index 00000000..8ecdfe06 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship01.ppm diff --git a/kspaceduel/sprites/ship2/ship02.pbm b/kspaceduel/sprites/ship2/ship02.pbm Binary files differnew file mode 100644 index 00000000..d89221b8 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship02.pbm diff --git a/kspaceduel/sprites/ship2/ship02.ppm b/kspaceduel/sprites/ship2/ship02.ppm Binary files differnew file mode 100644 index 00000000..5bb6af26 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship02.ppm diff --git a/kspaceduel/sprites/ship2/ship03.pbm b/kspaceduel/sprites/ship2/ship03.pbm Binary files differnew file mode 100644 index 00000000..6c758512 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship03.pbm diff --git a/kspaceduel/sprites/ship2/ship03.ppm b/kspaceduel/sprites/ship2/ship03.ppm Binary files differnew file mode 100644 index 00000000..cd34a9b7 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship03.ppm diff --git a/kspaceduel/sprites/ship2/ship04.pbm b/kspaceduel/sprites/ship2/ship04.pbm Binary files differnew file mode 100644 index 00000000..cb480126 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship04.pbm diff --git a/kspaceduel/sprites/ship2/ship04.ppm b/kspaceduel/sprites/ship2/ship04.ppm Binary files differnew file mode 100644 index 00000000..a1ec1250 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship04.ppm diff --git a/kspaceduel/sprites/ship2/ship05.pbm b/kspaceduel/sprites/ship2/ship05.pbm Binary files differnew file mode 100644 index 00000000..8c52f726 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship05.pbm diff --git a/kspaceduel/sprites/ship2/ship05.ppm b/kspaceduel/sprites/ship2/ship05.ppm Binary files differnew file mode 100644 index 00000000..facaf2c8 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship05.ppm diff --git a/kspaceduel/sprites/ship2/ship06.pbm b/kspaceduel/sprites/ship2/ship06.pbm Binary files differnew file mode 100644 index 00000000..4e275f75 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship06.pbm diff --git a/kspaceduel/sprites/ship2/ship06.ppm b/kspaceduel/sprites/ship2/ship06.ppm Binary files differnew file mode 100644 index 00000000..f773a627 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship06.ppm diff --git a/kspaceduel/sprites/ship2/ship07.pbm b/kspaceduel/sprites/ship2/ship07.pbm Binary files differnew file mode 100644 index 00000000..9ce84d59 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship07.pbm diff --git a/kspaceduel/sprites/ship2/ship07.ppm b/kspaceduel/sprites/ship2/ship07.ppm Binary files differnew file mode 100644 index 00000000..b7913b00 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship07.ppm diff --git a/kspaceduel/sprites/ship2/ship08.pbm b/kspaceduel/sprites/ship2/ship08.pbm Binary files differnew file mode 100644 index 00000000..ffbfb0fa --- /dev/null +++ b/kspaceduel/sprites/ship2/ship08.pbm diff --git a/kspaceduel/sprites/ship2/ship08.ppm b/kspaceduel/sprites/ship2/ship08.ppm Binary files differnew file mode 100644 index 00000000..79119eea --- /dev/null +++ b/kspaceduel/sprites/ship2/ship08.ppm diff --git a/kspaceduel/sprites/ship2/ship09.pbm b/kspaceduel/sprites/ship2/ship09.pbm Binary files differnew file mode 100644 index 00000000..4a46f232 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship09.pbm diff --git a/kspaceduel/sprites/ship2/ship09.ppm b/kspaceduel/sprites/ship2/ship09.ppm Binary files differnew file mode 100644 index 00000000..7e635876 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship09.ppm diff --git a/kspaceduel/sprites/ship2/ship10.pbm b/kspaceduel/sprites/ship2/ship10.pbm Binary files differnew file mode 100644 index 00000000..e93a6c72 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship10.pbm diff --git a/kspaceduel/sprites/ship2/ship10.ppm b/kspaceduel/sprites/ship2/ship10.ppm Binary files differnew file mode 100644 index 00000000..b3578f45 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship10.ppm diff --git a/kspaceduel/sprites/ship2/ship11.pbm b/kspaceduel/sprites/ship2/ship11.pbm Binary files differnew file mode 100644 index 00000000..13d2416b --- /dev/null +++ b/kspaceduel/sprites/ship2/ship11.pbm diff --git a/kspaceduel/sprites/ship2/ship11.ppm b/kspaceduel/sprites/ship2/ship11.ppm Binary files differnew file mode 100644 index 00000000..9df7a4c3 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship11.ppm diff --git a/kspaceduel/sprites/ship2/ship12.pbm b/kspaceduel/sprites/ship2/ship12.pbm Binary files differnew file mode 100644 index 00000000..4b344578 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship12.pbm diff --git a/kspaceduel/sprites/ship2/ship12.ppm b/kspaceduel/sprites/ship2/ship12.ppm Binary files differnew file mode 100644 index 00000000..7a6f532c --- /dev/null +++ b/kspaceduel/sprites/ship2/ship12.ppm diff --git a/kspaceduel/sprites/ship2/ship13.pbm b/kspaceduel/sprites/ship2/ship13.pbm Binary files differnew file mode 100644 index 00000000..29502533 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship13.pbm diff --git a/kspaceduel/sprites/ship2/ship13.ppm b/kspaceduel/sprites/ship2/ship13.ppm Binary files differnew file mode 100644 index 00000000..75ab41d6 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship13.ppm diff --git a/kspaceduel/sprites/ship2/ship14.pbm b/kspaceduel/sprites/ship2/ship14.pbm Binary files differnew file mode 100644 index 00000000..becd3f01 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship14.pbm diff --git a/kspaceduel/sprites/ship2/ship14.ppm b/kspaceduel/sprites/ship2/ship14.ppm Binary files differnew file mode 100644 index 00000000..753c615a --- /dev/null +++ b/kspaceduel/sprites/ship2/ship14.ppm diff --git a/kspaceduel/sprites/ship2/ship15.pbm b/kspaceduel/sprites/ship2/ship15.pbm Binary files differnew file mode 100644 index 00000000..e30e9994 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship15.pbm diff --git a/kspaceduel/sprites/ship2/ship15.ppm b/kspaceduel/sprites/ship2/ship15.ppm Binary files differnew file mode 100644 index 00000000..d12872ae --- /dev/null +++ b/kspaceduel/sprites/ship2/ship15.ppm diff --git a/kspaceduel/sprites/ship2/ship16.pbm b/kspaceduel/sprites/ship2/ship16.pbm Binary files differnew file mode 100644 index 00000000..7e42c115 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship16.pbm diff --git a/kspaceduel/sprites/ship2/ship16.ppm b/kspaceduel/sprites/ship2/ship16.ppm Binary files differnew file mode 100644 index 00000000..d0584030 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship16.ppm diff --git a/kspaceduel/sprites/ship2/ship17.pbm b/kspaceduel/sprites/ship2/ship17.pbm Binary files differnew file mode 100644 index 00000000..295c72da --- /dev/null +++ b/kspaceduel/sprites/ship2/ship17.pbm diff --git a/kspaceduel/sprites/ship2/ship17.ppm b/kspaceduel/sprites/ship2/ship17.ppm Binary files differnew file mode 100644 index 00000000..e2e164cb --- /dev/null +++ b/kspaceduel/sprites/ship2/ship17.ppm diff --git a/kspaceduel/sprites/ship2/ship18.pbm b/kspaceduel/sprites/ship2/ship18.pbm Binary files differnew file mode 100644 index 00000000..290b436f --- /dev/null +++ b/kspaceduel/sprites/ship2/ship18.pbm diff --git a/kspaceduel/sprites/ship2/ship18.ppm b/kspaceduel/sprites/ship2/ship18.ppm Binary files differnew file mode 100644 index 00000000..2e70ad30 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship18.ppm diff --git a/kspaceduel/sprites/ship2/ship19.pbm b/kspaceduel/sprites/ship2/ship19.pbm Binary files differnew file mode 100644 index 00000000..b6749b15 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship19.pbm diff --git a/kspaceduel/sprites/ship2/ship19.ppm b/kspaceduel/sprites/ship2/ship19.ppm Binary files differnew file mode 100644 index 00000000..473bf9a9 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship19.ppm diff --git a/kspaceduel/sprites/ship2/ship20.pbm b/kspaceduel/sprites/ship2/ship20.pbm Binary files differnew file mode 100644 index 00000000..dc74a396 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship20.pbm diff --git a/kspaceduel/sprites/ship2/ship20.ppm b/kspaceduel/sprites/ship2/ship20.ppm Binary files differnew file mode 100644 index 00000000..369de36e --- /dev/null +++ b/kspaceduel/sprites/ship2/ship20.ppm diff --git a/kspaceduel/sprites/ship2/ship21.pbm b/kspaceduel/sprites/ship2/ship21.pbm Binary files differnew file mode 100644 index 00000000..c23a98f6 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship21.pbm diff --git a/kspaceduel/sprites/ship2/ship21.ppm b/kspaceduel/sprites/ship2/ship21.ppm Binary files differnew file mode 100644 index 00000000..090ce9f0 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship21.ppm diff --git a/kspaceduel/sprites/ship2/ship22.pbm b/kspaceduel/sprites/ship2/ship22.pbm Binary files differnew file mode 100644 index 00000000..0fad8c90 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship22.pbm diff --git a/kspaceduel/sprites/ship2/ship22.ppm b/kspaceduel/sprites/ship2/ship22.ppm Binary files differnew file mode 100644 index 00000000..6991dd32 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship22.ppm diff --git a/kspaceduel/sprites/ship2/ship23.pbm b/kspaceduel/sprites/ship2/ship23.pbm Binary files differnew file mode 100644 index 00000000..5862f439 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship23.pbm diff --git a/kspaceduel/sprites/ship2/ship23.ppm b/kspaceduel/sprites/ship2/ship23.ppm Binary files differnew file mode 100644 index 00000000..250a3771 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship23.ppm diff --git a/kspaceduel/sprites/ship2/ship24.pbm b/kspaceduel/sprites/ship2/ship24.pbm Binary files differnew file mode 100644 index 00000000..857b2116 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship24.pbm diff --git a/kspaceduel/sprites/ship2/ship24.ppm b/kspaceduel/sprites/ship2/ship24.ppm Binary files differnew file mode 100644 index 00000000..55ac941b --- /dev/null +++ b/kspaceduel/sprites/ship2/ship24.ppm diff --git a/kspaceduel/sprites/ship2/ship25.pbm b/kspaceduel/sprites/ship2/ship25.pbm Binary files differnew file mode 100644 index 00000000..b8884975 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship25.pbm diff --git a/kspaceduel/sprites/ship2/ship25.ppm b/kspaceduel/sprites/ship2/ship25.ppm Binary files differnew file mode 100644 index 00000000..794fc038 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship25.ppm diff --git a/kspaceduel/sprites/ship2/ship26.pbm b/kspaceduel/sprites/ship2/ship26.pbm Binary files differnew file mode 100644 index 00000000..badd42a3 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship26.pbm diff --git a/kspaceduel/sprites/ship2/ship26.ppm b/kspaceduel/sprites/ship2/ship26.ppm Binary files differnew file mode 100644 index 00000000..cdc6ef50 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship26.ppm diff --git a/kspaceduel/sprites/ship2/ship27.pbm b/kspaceduel/sprites/ship2/ship27.pbm Binary files differnew file mode 100644 index 00000000..393b3f05 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship27.pbm diff --git a/kspaceduel/sprites/ship2/ship27.ppm b/kspaceduel/sprites/ship2/ship27.ppm Binary files differnew file mode 100644 index 00000000..4ec3cbd4 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship27.ppm diff --git a/kspaceduel/sprites/ship2/ship28.pbm b/kspaceduel/sprites/ship2/ship28.pbm Binary files differnew file mode 100644 index 00000000..31139aa8 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship28.pbm diff --git a/kspaceduel/sprites/ship2/ship28.ppm b/kspaceduel/sprites/ship2/ship28.ppm Binary files differnew file mode 100644 index 00000000..647923e1 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship28.ppm diff --git a/kspaceduel/sprites/ship2/ship29.pbm b/kspaceduel/sprites/ship2/ship29.pbm Binary files differnew file mode 100644 index 00000000..6c2a656c --- /dev/null +++ b/kspaceduel/sprites/ship2/ship29.pbm diff --git a/kspaceduel/sprites/ship2/ship29.ppm b/kspaceduel/sprites/ship2/ship29.ppm Binary files differnew file mode 100644 index 00000000..880526c1 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship29.ppm diff --git a/kspaceduel/sprites/ship2/ship30.pbm b/kspaceduel/sprites/ship2/ship30.pbm Binary files differnew file mode 100644 index 00000000..b456646b --- /dev/null +++ b/kspaceduel/sprites/ship2/ship30.pbm diff --git a/kspaceduel/sprites/ship2/ship30.ppm b/kspaceduel/sprites/ship2/ship30.ppm Binary files differnew file mode 100644 index 00000000..a367708c --- /dev/null +++ b/kspaceduel/sprites/ship2/ship30.ppm diff --git a/kspaceduel/sprites/ship2/ship31.pbm b/kspaceduel/sprites/ship2/ship31.pbm Binary files differnew file mode 100644 index 00000000..51279992 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship31.pbm diff --git a/kspaceduel/sprites/ship2/ship31.ppm b/kspaceduel/sprites/ship2/ship31.ppm Binary files differnew file mode 100644 index 00000000..f11ea682 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship31.ppm diff --git a/kspaceduel/sprites/ship2/ship32.pbm b/kspaceduel/sprites/ship2/ship32.pbm Binary files differnew file mode 100644 index 00000000..231f442f --- /dev/null +++ b/kspaceduel/sprites/ship2/ship32.pbm diff --git a/kspaceduel/sprites/ship2/ship32.ppm b/kspaceduel/sprites/ship2/ship32.ppm Binary files differnew file mode 100644 index 00000000..3710e5d8 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship32.ppm diff --git a/kspaceduel/sprites/ship2/ship33.pbm b/kspaceduel/sprites/ship2/ship33.pbm Binary files differnew file mode 100644 index 00000000..967d7531 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship33.pbm diff --git a/kspaceduel/sprites/ship2/ship33.ppm b/kspaceduel/sprites/ship2/ship33.ppm Binary files differnew file mode 100644 index 00000000..8d0fb3a3 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship33.ppm diff --git a/kspaceduel/sprites/ship2/ship34.pbm b/kspaceduel/sprites/ship2/ship34.pbm Binary files differnew file mode 100644 index 00000000..935fc508 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship34.pbm diff --git a/kspaceduel/sprites/ship2/ship34.ppm b/kspaceduel/sprites/ship2/ship34.ppm Binary files differnew file mode 100644 index 00000000..412ae1e3 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship34.ppm diff --git a/kspaceduel/sprites/ship2/ship35.pbm b/kspaceduel/sprites/ship2/ship35.pbm Binary files differnew file mode 100644 index 00000000..7fc405ee --- /dev/null +++ b/kspaceduel/sprites/ship2/ship35.pbm diff --git a/kspaceduel/sprites/ship2/ship35.ppm b/kspaceduel/sprites/ship2/ship35.ppm Binary files differnew file mode 100644 index 00000000..a7d53fd8 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship35.ppm diff --git a/kspaceduel/sprites/ship2/ship36.pbm b/kspaceduel/sprites/ship2/ship36.pbm Binary files differnew file mode 100644 index 00000000..9e081991 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship36.pbm diff --git a/kspaceduel/sprites/ship2/ship36.ppm b/kspaceduel/sprites/ship2/ship36.ppm Binary files differnew file mode 100644 index 00000000..f0bd791d --- /dev/null +++ b/kspaceduel/sprites/ship2/ship36.ppm diff --git a/kspaceduel/sprites/ship2/ship37.pbm b/kspaceduel/sprites/ship2/ship37.pbm Binary files differnew file mode 100644 index 00000000..85d5a716 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship37.pbm diff --git a/kspaceduel/sprites/ship2/ship37.ppm b/kspaceduel/sprites/ship2/ship37.ppm Binary files differnew file mode 100644 index 00000000..cf221325 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship37.ppm diff --git a/kspaceduel/sprites/ship2/ship38.pbm b/kspaceduel/sprites/ship2/ship38.pbm Binary files differnew file mode 100644 index 00000000..97544c97 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship38.pbm diff --git a/kspaceduel/sprites/ship2/ship38.ppm b/kspaceduel/sprites/ship2/ship38.ppm Binary files differnew file mode 100644 index 00000000..4b9c41a2 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship38.ppm diff --git a/kspaceduel/sprites/ship2/ship39.pbm b/kspaceduel/sprites/ship2/ship39.pbm Binary files differnew file mode 100644 index 00000000..72485ed4 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship39.pbm diff --git a/kspaceduel/sprites/ship2/ship39.ppm b/kspaceduel/sprites/ship2/ship39.ppm Binary files differnew file mode 100644 index 00000000..f920b9c5 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship39.ppm diff --git a/kspaceduel/sprites/ship2/ship40.pbm b/kspaceduel/sprites/ship2/ship40.pbm Binary files differnew file mode 100644 index 00000000..05ce8d9e --- /dev/null +++ b/kspaceduel/sprites/ship2/ship40.pbm diff --git a/kspaceduel/sprites/ship2/ship40.ppm b/kspaceduel/sprites/ship2/ship40.ppm Binary files differnew file mode 100644 index 00000000..982ca694 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship40.ppm diff --git a/kspaceduel/sprites/ship2/ship41.pbm b/kspaceduel/sprites/ship2/ship41.pbm Binary files differnew file mode 100644 index 00000000..55556661 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship41.pbm diff --git a/kspaceduel/sprites/ship2/ship41.ppm b/kspaceduel/sprites/ship2/ship41.ppm Binary files differnew file mode 100644 index 00000000..c75c12d7 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship41.ppm diff --git a/kspaceduel/sprites/ship2/ship42.pbm b/kspaceduel/sprites/ship2/ship42.pbm Binary files differnew file mode 100644 index 00000000..f0bef294 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship42.pbm diff --git a/kspaceduel/sprites/ship2/ship42.ppm b/kspaceduel/sprites/ship2/ship42.ppm Binary files differnew file mode 100644 index 00000000..1f402bf8 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship42.ppm diff --git a/kspaceduel/sprites/ship2/ship43.pbm b/kspaceduel/sprites/ship2/ship43.pbm Binary files differnew file mode 100644 index 00000000..16040fa5 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship43.pbm diff --git a/kspaceduel/sprites/ship2/ship43.ppm b/kspaceduel/sprites/ship2/ship43.ppm Binary files differnew file mode 100644 index 00000000..5151dde5 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship43.ppm diff --git a/kspaceduel/sprites/ship2/ship44.pbm b/kspaceduel/sprites/ship2/ship44.pbm Binary files differnew file mode 100644 index 00000000..8cea22b3 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship44.pbm diff --git a/kspaceduel/sprites/ship2/ship44.ppm b/kspaceduel/sprites/ship2/ship44.ppm Binary files differnew file mode 100644 index 00000000..12cac1d8 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship44.ppm diff --git a/kspaceduel/sprites/ship2/ship45.pbm b/kspaceduel/sprites/ship2/ship45.pbm Binary files differnew file mode 100644 index 00000000..833b42b5 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship45.pbm diff --git a/kspaceduel/sprites/ship2/ship45.ppm b/kspaceduel/sprites/ship2/ship45.ppm Binary files differnew file mode 100644 index 00000000..039ef873 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship45.ppm diff --git a/kspaceduel/sprites/ship2/ship46.pbm b/kspaceduel/sprites/ship2/ship46.pbm Binary files differnew file mode 100644 index 00000000..74887081 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship46.pbm diff --git a/kspaceduel/sprites/ship2/ship46.ppm b/kspaceduel/sprites/ship2/ship46.ppm Binary files differnew file mode 100644 index 00000000..9c274173 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship46.ppm diff --git a/kspaceduel/sprites/ship2/ship47.pbm b/kspaceduel/sprites/ship2/ship47.pbm Binary files differnew file mode 100644 index 00000000..be47bb91 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship47.pbm diff --git a/kspaceduel/sprites/ship2/ship47.ppm b/kspaceduel/sprites/ship2/ship47.ppm Binary files differnew file mode 100644 index 00000000..ab00ac53 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship47.ppm diff --git a/kspaceduel/sprites/ship2/ship48.pbm b/kspaceduel/sprites/ship2/ship48.pbm Binary files differnew file mode 100644 index 00000000..0b2d3e6e --- /dev/null +++ b/kspaceduel/sprites/ship2/ship48.pbm diff --git a/kspaceduel/sprites/ship2/ship48.ppm b/kspaceduel/sprites/ship2/ship48.ppm Binary files differnew file mode 100644 index 00000000..5ff7d24f --- /dev/null +++ b/kspaceduel/sprites/ship2/ship48.ppm diff --git a/kspaceduel/sprites/ship2/ship49.pbm b/kspaceduel/sprites/ship2/ship49.pbm Binary files differnew file mode 100644 index 00000000..83ac8363 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship49.pbm diff --git a/kspaceduel/sprites/ship2/ship49.ppm b/kspaceduel/sprites/ship2/ship49.ppm Binary files differnew file mode 100644 index 00000000..7ec6455d --- /dev/null +++ b/kspaceduel/sprites/ship2/ship49.ppm diff --git a/kspaceduel/sprites/ship2/ship50.pbm b/kspaceduel/sprites/ship2/ship50.pbm Binary files differnew file mode 100644 index 00000000..20e5b229 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship50.pbm diff --git a/kspaceduel/sprites/ship2/ship50.ppm b/kspaceduel/sprites/ship2/ship50.ppm Binary files differnew file mode 100644 index 00000000..a11cd0f0 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship50.ppm diff --git a/kspaceduel/sprites/ship2/ship51.pbm b/kspaceduel/sprites/ship2/ship51.pbm Binary files differnew file mode 100644 index 00000000..948062b5 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship51.pbm diff --git a/kspaceduel/sprites/ship2/ship51.ppm b/kspaceduel/sprites/ship2/ship51.ppm Binary files differnew file mode 100644 index 00000000..3974678c --- /dev/null +++ b/kspaceduel/sprites/ship2/ship51.ppm diff --git a/kspaceduel/sprites/ship2/ship52.pbm b/kspaceduel/sprites/ship2/ship52.pbm Binary files differnew file mode 100644 index 00000000..bbb498ec --- /dev/null +++ b/kspaceduel/sprites/ship2/ship52.pbm diff --git a/kspaceduel/sprites/ship2/ship52.ppm b/kspaceduel/sprites/ship2/ship52.ppm Binary files differnew file mode 100644 index 00000000..9b5075dc --- /dev/null +++ b/kspaceduel/sprites/ship2/ship52.ppm diff --git a/kspaceduel/sprites/ship2/ship53.pbm b/kspaceduel/sprites/ship2/ship53.pbm Binary files differnew file mode 100644 index 00000000..51fcf071 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship53.pbm diff --git a/kspaceduel/sprites/ship2/ship53.ppm b/kspaceduel/sprites/ship2/ship53.ppm Binary files differnew file mode 100644 index 00000000..27da47fa --- /dev/null +++ b/kspaceduel/sprites/ship2/ship53.ppm diff --git a/kspaceduel/sprites/ship2/ship54.pbm b/kspaceduel/sprites/ship2/ship54.pbm Binary files differnew file mode 100644 index 00000000..7ed85a20 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship54.pbm diff --git a/kspaceduel/sprites/ship2/ship54.ppm b/kspaceduel/sprites/ship2/ship54.ppm Binary files differnew file mode 100644 index 00000000..fb4373a1 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship54.ppm diff --git a/kspaceduel/sprites/ship2/ship55.pbm b/kspaceduel/sprites/ship2/ship55.pbm Binary files differnew file mode 100644 index 00000000..97223e26 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship55.pbm diff --git a/kspaceduel/sprites/ship2/ship55.ppm b/kspaceduel/sprites/ship2/ship55.ppm Binary files differnew file mode 100644 index 00000000..54939d95 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship55.ppm diff --git a/kspaceduel/sprites/ship2/ship56.pbm b/kspaceduel/sprites/ship2/ship56.pbm Binary files differnew file mode 100644 index 00000000..49cf8e8a --- /dev/null +++ b/kspaceduel/sprites/ship2/ship56.pbm diff --git a/kspaceduel/sprites/ship2/ship56.ppm b/kspaceduel/sprites/ship2/ship56.ppm Binary files differnew file mode 100644 index 00000000..b37e12f1 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship56.ppm diff --git a/kspaceduel/sprites/ship2/ship57.pbm b/kspaceduel/sprites/ship2/ship57.pbm Binary files differnew file mode 100644 index 00000000..6b5b3922 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship57.pbm diff --git a/kspaceduel/sprites/ship2/ship57.ppm b/kspaceduel/sprites/ship2/ship57.ppm Binary files differnew file mode 100644 index 00000000..0220769f --- /dev/null +++ b/kspaceduel/sprites/ship2/ship57.ppm diff --git a/kspaceduel/sprites/ship2/ship58.pbm b/kspaceduel/sprites/ship2/ship58.pbm Binary files differnew file mode 100644 index 00000000..a669df91 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship58.pbm diff --git a/kspaceduel/sprites/ship2/ship58.ppm b/kspaceduel/sprites/ship2/ship58.ppm Binary files differnew file mode 100644 index 00000000..b4e1fbe9 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship58.ppm diff --git a/kspaceduel/sprites/ship2/ship59.pbm b/kspaceduel/sprites/ship2/ship59.pbm Binary files differnew file mode 100644 index 00000000..005b4bdf --- /dev/null +++ b/kspaceduel/sprites/ship2/ship59.pbm diff --git a/kspaceduel/sprites/ship2/ship59.ppm b/kspaceduel/sprites/ship2/ship59.ppm Binary files differnew file mode 100644 index 00000000..ec1e44a7 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship59.ppm diff --git a/kspaceduel/sprites/ship2/ship60.pbm b/kspaceduel/sprites/ship2/ship60.pbm Binary files differnew file mode 100644 index 00000000..9829ce5e --- /dev/null +++ b/kspaceduel/sprites/ship2/ship60.pbm diff --git a/kspaceduel/sprites/ship2/ship60.ppm b/kspaceduel/sprites/ship2/ship60.ppm Binary files differnew file mode 100644 index 00000000..f66b15cc --- /dev/null +++ b/kspaceduel/sprites/ship2/ship60.ppm diff --git a/kspaceduel/sprites/ship2/ship61.pbm b/kspaceduel/sprites/ship2/ship61.pbm Binary files differnew file mode 100644 index 00000000..b055eefe --- /dev/null +++ b/kspaceduel/sprites/ship2/ship61.pbm diff --git a/kspaceduel/sprites/ship2/ship61.ppm b/kspaceduel/sprites/ship2/ship61.ppm Binary files differnew file mode 100644 index 00000000..c4fea47e --- /dev/null +++ b/kspaceduel/sprites/ship2/ship61.ppm diff --git a/kspaceduel/sprites/ship2/ship62.pbm b/kspaceduel/sprites/ship2/ship62.pbm Binary files differnew file mode 100644 index 00000000..6378eec9 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship62.pbm diff --git a/kspaceduel/sprites/ship2/ship62.ppm b/kspaceduel/sprites/ship2/ship62.ppm Binary files differnew file mode 100644 index 00000000..e88befbc --- /dev/null +++ b/kspaceduel/sprites/ship2/ship62.ppm diff --git a/kspaceduel/sprites/ship2/ship63.pbm b/kspaceduel/sprites/ship2/ship63.pbm Binary files differnew file mode 100644 index 00000000..4da971a2 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship63.pbm diff --git a/kspaceduel/sprites/ship2/ship63.ppm b/kspaceduel/sprites/ship2/ship63.ppm Binary files differnew file mode 100644 index 00000000..27bea663 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship63.ppm diff --git a/kspaceduel/sprites/ship2/ship64.pbm b/kspaceduel/sprites/ship2/ship64.pbm Binary files differnew file mode 100644 index 00000000..a144ef6b --- /dev/null +++ b/kspaceduel/sprites/ship2/ship64.pbm diff --git a/kspaceduel/sprites/ship2/ship64.ppm b/kspaceduel/sprites/ship2/ship64.ppm Binary files differnew file mode 100644 index 00000000..954fc1b2 --- /dev/null +++ b/kspaceduel/sprites/ship2/ship64.ppm diff --git a/kspaceduel/sprites/sun/Makefile.am b/kspaceduel/sprites/sun/Makefile.am new file mode 100644 index 00000000..0e50b0e2 --- /dev/null +++ b/kspaceduel/sprites/sun/Makefile.am @@ -0,0 +1,3 @@ +sundir = $(kde_datadir)/kspaceduel/sprites/sun +sun_DATA = sun.ppm sun.pbm +EXTRA_DIST = $(sun_DATA) diff --git a/kspaceduel/sprites/sun/sun.pbm b/kspaceduel/sprites/sun/sun.pbm Binary files differnew file mode 100644 index 00000000..fc4eda67 --- /dev/null +++ b/kspaceduel/sprites/sun/sun.pbm diff --git a/kspaceduel/sprites/sun/sun.ppm b/kspaceduel/sprites/sun/sun.ppm Binary files differnew file mode 100644 index 00000000..27494a9a --- /dev/null +++ b/kspaceduel/sprites/sun/sun.ppm diff --git a/kspaceduel/structs.h b/kspaceduel/structs.h new file mode 100644 index 00000000..e58b182a --- /dev/null +++ b/kspaceduel/structs.h @@ -0,0 +1,46 @@ +#ifndef __SP_STRUCTS_H +#define __SP_STRUCTS_H + +struct SConfig +{ + double gamespeed,gravity,acc,energyNeed,sunEnergy,rotationSpeed, + mineActivateTime,mineFuel,shotSpeed,shotEnergyNeed,mineEnergyNeed, + rotationEnergyNeed,startPosX,startPosY,startVelX,startVelY, + bulletLifeTime,mineReloadTime,bulletReloadTime; + unsigned bulletDamage,shipDamage,mineDamage,maxBullets,maxMines; + double powerupLifeTime, powerupRefreshTime; + double powerupEnergyAmount; + unsigned powerupShieldAmount; +}; + +bool operator!=(const SConfig &s1, const SConfig &s2); + +#define predefinedConfigNum 4 +const SConfig predefinedConfig[]={{1.0, 2200.0, 0.2, 1.0, 9000.0, 1.0, + 15.0, 65.0, 3.0, 10.0, 5.0, + 0.2, -130.0, -100.0, 3.0, -1.7, + 500.0,10.0,10.0, + 20, 50, 30, 5, 3, + 400.0, 800.0, 50, 30}, + {1.0, 2200.0, 0.2, 1.0, 9000.0, 1.0, + 15.0, 40.0, 5.0, 20.0, 10.0, + 0.2, -50.0, -150.0, 3.5, 0.9, + 500.0,10.0,10.0, + 20, 50, 30, 6, 2, + 400.0, 800.0, 50, 30}, + {1.3, 2200.0, 0.2, 1.0, 13000.0, 1.0, + 15.0, 50.0, 4.0, 10.0, 10.0, + 0.2, -50.0, -150.0, 3.2, -0.9, + 400.0,10.0,10.0, + 20, 50, 30, 7, 5, + 400.0, 800.0, 50, 30}, + {1.0, 2200.0, 0.2, 1.0, 9000.0, 1.0, + 15.0, 40.0, 5.0, 60.0, 50.0, + 0.4, -50.0, -170.0, 3.0, -0.5, + 500.0,10.0,10.0, + 20, 50, 30, 5, 3, + 400.0, 800.0, 50, 30}}; +const char predefinedConfigName[predefinedConfigNum][15]= +{"Default","Bullet","Chaos","Lack of Energy"}; + +#endif diff --git a/kspaceduel/topwidget.cpp b/kspaceduel/topwidget.cpp new file mode 100644 index 00000000..9f275848 --- /dev/null +++ b/kspaceduel/topwidget.cpp @@ -0,0 +1,144 @@ +#include <klocale.h> +#include <kaccel.h> +#include <kkeydialog.h> +#include <kaction.h> +#include <kstdgameaction.h> +#include <qlayout.h> +#include <kstatusbar.h> + +#include "topwidget.h" +#include "mainview.h" +#include "playerinfo.h" + +MyTopLevelWidget::MyTopLevelWidget() +{ + initGameWidgets(); + initStatusBar( ); + initActions( ); + setupGUI( ); +} + +void MyTopLevelWidget::initGameWidgets( ){ + QWidget *w = new QWidget(this); + + playerinfo[0]=new PlayerInfo(0,w); + playerinfo[1]=new PlayerInfo(1,w); + playfield=new MyMainView(w); + + QBoxLayout *toplayout=new QHBoxLayout(w); + toplayout->addWidget(playerinfo[0]); + toplayout->addWidget(playfield); + toplayout->addWidget(playerinfo[1]); + toplayout->activate(); + + playfield->setFocusPolicy(QWidget::StrongFocus); + playfield->setFocus(); + + QObject::connect(playfield,SIGNAL(energy(int,int)), + SLOT(energy(int,int))); + QObject::connect(playfield,SIGNAL(hitPoints(int,int)), + SLOT(hitPoints(int,int))); + QObject::connect(playfield,SIGNAL(wins(int,int)),SLOT(wins(int,int))); + QObject::connect(playfield,SIGNAL(setStatusText(const QString &,int)), + SLOT(setStatusText(const QString &,int))); + + setCentralWidget(w); +} + +void MyTopLevelWidget::energy(int pn,int en) +{ + playerinfo[pn]->setEnergy(en); +} + +void MyTopLevelWidget::hitPoints(int pn,int hp) +{ + playerinfo[pn]->setHitpoints(hp); +} + +void MyTopLevelWidget::wins(int pn,int w) +{ + playerinfo[pn]->setWins(w); +} + +void MyTopLevelWidget::initActions( ) +{ + KStdGameAction::quit(this, SLOT(close()), actionCollection()); + KStdGameAction::gameNew(playfield, SLOT(newGame()), actionCollection()); + ( void )new KAction( i18n( "&New Round" ), "spnewround", + CTRL + Key_R, playfield, SLOT( newRound( ) ), + actionCollection( ), "new_round" ); + MyMainView::pauseAction = + KStdGameAction::pause(playfield, SLOT(togglePause()), actionCollection()); + MyMainView::pauseAction->setChecked( false ); + KAction* gameStart = new KAction( i18n( "Start" ), GAME_START_SHORTCUT, + playfield, SLOT( start( ) ), actionCollection( ), "game_start" ); + + KStdAction::preferences(playfield, SLOT(gameSetup()), actionCollection()); + + KAccel* acc = new KAccel(this); + gameStart->plugAccel(acc); + + // Default keys + actionCollection()->setAutoConnectShortcuts(false); + KAction* ac; + ac = new KAction(i18n("Player 1 Rotate Left"), Key_S, 0, 0, + actionCollection(), "P1KeyLeft"); + ac->setEnabled( false ); + ac = new KAction(i18n("Player 1 Rotate Right"), Key_F, 0, 0, + actionCollection(), "P1KeyRight"); + ac->setEnabled( false ); + ac = new KAction(i18n("Player 1 Accelerate"), Key_E, 0, 0, + actionCollection(), "P1KeyAcc"); + ac->setEnabled( false ); + ac = new KAction(i18n("Player 1 Shot"), Key_D, 0, 0, + actionCollection(), "P1Shot"); + ac->setEnabled( false ); + ac = new KAction(i18n("Player 1 Mine"), Key_A, 0, 0, + actionCollection(), "P1Mine"); + ac->setEnabled( false ); + + ac = new KAction(i18n("Player 2 Rotate Left"), Key_Left, 0, 0, + actionCollection(), "P2KeyLeft"); + ac->setEnabled( false ); + ac = new KAction(i18n("Player 2 Rotate Right"), Key_Right, 0, 0, + actionCollection(), "P2KeyRight"); + ac->setEnabled( false ); + ac = new KAction(i18n("Player 2 Accelerate"), Key_Up, 0, 0, + actionCollection(), "P2KeyAcc"); + ac->setEnabled( false ); + ac = new KAction(i18n("Player 2 Shot"), Key_Down, 0, 0, + actionCollection(), "P2Shot"); + ac->setEnabled( false ); + ac = new KAction(i18n("Player 2 Mine"), Key_Insert, 0, 0, + actionCollection(), "P2Mine"); + ac->setEnabled( false ); + + actionCollection()->setAutoConnectShortcuts(true); + playfield->setActionCollection(actionCollection()); +} + +void MyTopLevelWidget::initStatusBar( ) +{ + statusBar( )->insertItem(i18n(" paused "),IDS_PAUSE,1); + statusBar( )->insertItem(" ",IDS_MAIN,1); + statusBar( )->insertItem("",42,2); +} + +void MyTopLevelWidget::start() +{ + playfield->newGame(); + playfield->newRound(); +} + +void MyTopLevelWidget::setStatusText(const QString & str,int id) +{ + statusBar( )->changeItem(str,id); +} + +void MyTopLevelWidget::keySetup() +{ + playfield->pause(); + KKeyDialog::configure( actionCollection( ), this, true ); +} + +#include "topwidget.moc" diff --git a/kspaceduel/topwidget.h b/kspaceduel/topwidget.h new file mode 100644 index 00000000..39c0f5d3 --- /dev/null +++ b/kspaceduel/topwidget.h @@ -0,0 +1,33 @@ +#ifndef __MY_TOP_WIDGET_H +#define __MY_TOP_WIDGET_H + +#include <kmainwindow.h> + +class PlayerInfo; +class MyMainView; + +class MyTopLevelWidget:public KMainWindow +{ + Q_OBJECT +public: + MyTopLevelWidget(); + void start(); + +private slots: + void setStatusText(const QString & text,int id); + void keySetup(); + void energy(int pn,int en); + void hitPoints(int pn,int hp); + void wins(int pn,int w); + +protected: + void initActions( ); + void initStatusBar( ); + void initGameWidgets(); + +private: + PlayerInfo *playerinfo[2]; + MyMainView *playfield; +}; + +#endif diff --git a/kspaceduel/version.h b/kspaceduel/version.h new file mode 100644 index 00000000..531f6c0a --- /dev/null +++ b/kspaceduel/version.h @@ -0,0 +1 @@ +#define KSPACEDUEL_VERSION "1.1" |