9 #include <QGraphicsScene> 11 #include <QGraphicsItem> 19 setBrush(QColor(
"black"));
20 QGraphicsTextItem * studentName =
new QGraphicsTextItem(
this);
21 studentName->setPlainText(
"rm -rf /");
22 studentName->adjustSize();
23 studentName->setDefaultTextColor(QColor(
"white"));
24 studentName->setPos(3,20);
56 setPos(x()+data.
X,y());
57 else if ((pos().x() + data.
X) <= 0)
62 setPos(x(),y()+data.
Y);
63 else if ((pos().y() + data.
Y) <= 0)
73 setFlag(QGraphicsItem::ItemIsFocusable);
GameSettings * _gameSettings
Uchwyt do globalnych ustawień gry.
qreal Y
Wartość osi Y o ile trzeba przesunąć studenta.
bool _stopStudent
Flaga zatrzymania studenta.
Dane przesunięcia studenta.
void resetPosition()
Ustawienie studenta do pozycji początkowej.
int studentWidth
Szerokość studenta.
void on_Game_stopStudent()
Zatrzymuje studenta.
void on_Game_startStudent()
Odblokowuje możliwości ruchu studentowi.
void moveStudent(moveData data)
Poruszanie studenta po scenie.
int sceneHeight
Wysokość sceny (okienka z grą)
qreal X
Wartość osi X o ile trzeba przesunąć studenta.
Definuje ustawienia gryModeluje pojęcie ustawień gry, jako struktura odpowiednich pól...
int studentHeight
Wysokość studenta.
Student(GameSettings *gSettings, QObject *parent=nullptr)
Kontrutor klasy Student.
int sceneWidth
Szerokość sceny (okienka z grą)