Files
aliendefender/games.cpp
2010-02-09 10:14:09 +03:00

20 lines
557 B
C++

#include "games.h"
games::games(QSize formsize, QPoint startpnt, QPoint finishpnt, int sizeofcell)
{
buff = new QPixmap(formsize);
background = new QPixmap(formsize);
cellsize = sizeofcell;
size = formsize/cellsize;
start = startpnt/cellsize;
finish = finishpnt/cellsize;
Cells = new int*[size.width()];
for (int i = 0; i < size.width(); i++) {
Cells[i] = new int[size.height()];
for (int j = 0; j < size.height(); j++) Cells[i][j] = 0;
}
Cells[start.x()][start.y()] = 10;
Cells[finish.x()][finish.y()] = 10;
qDebug() << start << finish;
}