You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
439 B

#include "health.h"
#include <QFont>
#include <QGraphicsTextItem>
Health::Health(QGraphicsItem *parent): QGraphicsTextItem(parent){
health = 3;
setPlainText(QString("Health: ") + QString::number(health));
setDefaultTextColor(Qt::red);
setFont(QFont("times",16));
}
void Health::decrease(){
health--;
setPlainText(QString("Health: ") + QString::number(health));
}
int Health::getHealth(){
return health;
}