SuperSpaceInvaderTurboApoca.../src/player.cpp
2022-01-09 04:24:25 +01:00

29 lines
460 B
C++

/**
*
* @file player.h
* @author RUBINI Thomas
* @author SIMAILA Djalim
* @date January 2022
* @version 1.0
* @brief player data storage
*
**/
#include "player.h"
bool Player::isPlaying() const {
return !isEliminated() && !hasDeathAnimation();
}
bool Player::hasDeathAnimation() const {
return deathAnimCounter!=0;
}
bool Player::isEliminated() const {
return lives == 0;
}
void Player::damage() {
--lives;
deathAnimCounter = 1;
}