SUPER Space invader : Turbo edition DX - VS GOD 1.0.0
A simple space invader ripoff
player.cpp
Go to the documentation of this file.
1
12#include "player.h"
13
14bool Player::isPlaying() const {
15 return !isEliminated() && !hasDeathAnimation();
16}
17
19 return deathAnimCounter!=0;
20}
21
23 return lives == 0;
24}
25
27 --lives;
29}
player data storage
bool isPlaying() const
Tells if the player is playing, or has a death animation/is eliminated.
Definition: player.cpp:14
void damage()
Damage the player (no precondition on existing state)
Definition: player.cpp:26
unsigned deathAnimCounter
counter used for the death animation of players undefined once the player is eliminated
Definition: player.h:45
bool hasDeathAnimation() const
Tells if the player has a death animation ongoing.
Definition: player.cpp:18
bool isEliminated() const
Tells if the player is eliminated (no more lives)
Definition: player.cpp:22
unsigned lives
player life points
Definition: player.h:24