Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include"health.h"
- #include "game.h"
- #include <QFont>
- Health::Health(QGraphicsItem *parent): QGraphicsTextItem(parent)
- {
- hh = 3;
- //draw the text
- setPlainText(("Health: ") + QString::number(hh));
- setDefaultTextColor(Qt::white);
- setFont(QFont("times", 16));
- }
- void Health::decrease()
- {
- hh--;
- if(hh==0){
- //setFont(QFont("times", 60));
- // setPlainText(("BUAHA U ARE DEAD"));
- //Game *game = new Game();//dupa
- game->GameOver();//keke
- return;
- }
- setPlainText(("Health: ") + QString::number(hh));
- }
- int Health::getHealth()
- {
- return hh;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement