Serduszka działają

do zrobienia jeszcze animacja uderzenia się w meteoryt (miganie) i wybuch statku przy uderzeniu się w meteoryt po raz trzeci
This commit is contained in:
2024-12-06 12:24:39 +01:00
parent 3b637508e1
commit 2f9e0ba236
6 changed files with 213 additions and 138 deletions

View File

@@ -24,6 +24,25 @@ Position Actor::getPosition() {
return {position.x, position.y};
}
unsigned int Actor::getHP() {
return hp;
}
void Actor::dealDamage() {
if(damageDealClock.getElapsedTime().asSeconds() > 1) {
if(hp > 0) {
hp--;
}
damageDealClock.restart();
}
}
void Actor::healUP() {
if(hp < 3){
hp++;
}
}
std::vector<Bullet> &Actor::getBullets() {
return bullets;
}
@@ -38,4 +57,4 @@ void Actor::updateBullets() {
void Actor::setMovingSpeed(float speed) {
moving_speed = speed;
}
}