calculate tower angle

switch autocontrol for splashes
This commit is contained in:
root
2010-08-30 16:40:40 +04:00
parent 13f8040f4e
commit 3e6460abd4
5 changed files with 272 additions and 141 deletions

View File

@@ -72,6 +72,7 @@ void AD_Graphics::drawBackground(QPainter * p, const QRectF & )
p->drawRect(i*cellSize,j*cellSize,cellSize,cellSize);
}
}
qDebug() << "t:" << data->curTowers.size();
for (QHash<QPoint, TowerType>::iterator i = data->curTowers.begin(); i != data->curTowers.end(); ++i) {
//qDebug() << "draw alien";
//p->rotate(-90);
@@ -80,7 +81,7 @@ void AD_Graphics::drawBackground(QPainter * p, const QRectF & )
//p->rotate(-90);
//p->translate(-rec.height()/2, -rec.width()/2);
QBrush brush;
brush.setColor(Qt::darkGreen);
brush.setColor(Qt::darkRed);
brush.setStyle(Qt::DiagCrossPattern);
p->translate((*i).pos * cellSize+QPointF(10,10));
p->rotate((*i).angle);
@@ -89,6 +90,7 @@ void AD_Graphics::drawBackground(QPainter * p, const QRectF & )
p->drawRect(QRect(-10,-10,20,20));
p->resetTransform();
}
qDebug() << "a:" << data->curAliens.size();
for (QHash<int, AlienType>::iterator i = data->curAliens.begin(); i != data->curAliens.end(); ++i) {
//qDebug() << "draw alien";
//p->rotate(-90);
@@ -101,6 +103,7 @@ void AD_Graphics::drawBackground(QPainter * p, const QRectF & )
p->drawImage(QRect(-20,-20,40,40), images[itAliens][0]->at(0));
p->resetTransform();
}
qDebug() << "s:" << data->curSplashes.size();
for (QHash<int, SplashType>::iterator i = data->curSplashes.begin(); i != data->curSplashes.end(); ++i) {
//qDebug() << "draw alien";
//p->rotate(-90);