Aliens create, wavetrace work, towers build, aliens move - thats all by now. I think it is time to write Graphic and Network modules.
32 lines
738 B
C++
32 lines
738 B
C++
#include "adcore.h"
|
|
|
|
adCore::adCore(QObject *parent) :
|
|
QThread(parent)
|
|
{
|
|
step = 0;
|
|
admap = new Map(1);
|
|
addata = new Game_Data(admap);
|
|
Player * pl1 = new Player(0);
|
|
Player * pl2 = new Player(0);
|
|
addata->players.push_back(pl1);
|
|
addata->players.push_back(pl2);
|
|
adaliens = new Aliens(addata);
|
|
adtowers = new Towers(addata);
|
|
adsplashes = new Splashes(addata);
|
|
connect(admap,SIGNAL(RecreateAlienPath(bool*)),adaliens,SLOT(retrace(bool*)));
|
|
adaliens->AddAlien(0);
|
|
adaliens->AddAlien(0);
|
|
adaliens->AddAlien(0);
|
|
for (int i=0; i<qMin(admap->mapsize.width(),admap->mapsize.height()); i++)
|
|
adtowers->AddTower(0,0,QPoint(i,i));
|
|
}
|
|
|
|
|
|
void adCore::next()
|
|
{
|
|
adtowers->update();
|
|
adsplashes->update();
|
|
adaliens->update();
|
|
step++;
|
|
}
|