SUPER Space invader : Turbo edition DX - VS GOD 1.0.0
A simple space invader ripoff
Player Struct Reference

player data structure More...

#include <player.h>

Public Member Functions

bool hasDeathAnimation () const
 Tells if the player has a death animation ongoing. More...
 
bool isEliminated () const
 Tells if the player is eliminated (no more lives) More...
 
bool isPlaying () const
 Tells if the player is playing, or has a death animation/is eliminated. More...
 
void damage ()
 Damage the player (no precondition on existing state) More...
 

Public Attributes

unsigned lives = 3
 player life points More...
 
unsigned x
 x coordinate of the player More...
 
unsigned id
 player's unique identidier More...
 
unsigned score =0
 player's personal score More...
 
unsigned deathAnimCounter =0
 counter used for the death animation of players undefined once the player is eliminated More...
 
unsigned fireCooldown =0
 player's shooting cooldown
More...
 

Detailed Description

player data structure

Definition at line 19 of file player.h.

Member Function Documentation

◆ damage()

void Player::damage ( )

Damage the player (no precondition on existing state)

Definition at line 26 of file player.cpp.

◆ hasDeathAnimation()

bool Player::hasDeathAnimation ( ) const

Tells if the player has a death animation ongoing.

Returns
true is the player has a death animation ongoing

Definition at line 18 of file player.cpp.

Here is the caller graph for this function:

◆ isEliminated()

bool Player::isEliminated ( ) const

Tells if the player is eliminated (no more lives)

Returns
true is the player is eliminated (no more lives)

Definition at line 22 of file player.cpp.

Here is the caller graph for this function:

◆ isPlaying()

bool Player::isPlaying ( ) const

Tells if the player is playing, or has a death animation/is eliminated.

Returns
true is the player is playing

Definition at line 14 of file player.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ deathAnimCounter

unsigned Player::deathAnimCounter =0

counter used for the death animation of players undefined once the player is eliminated

Definition at line 45 of file player.h.

◆ fireCooldown

unsigned Player::fireCooldown =0

player's shooting cooldown

Definition at line 50 of file player.h.

◆ id

unsigned Player::id

player's unique identidier

Definition at line 34 of file player.h.

◆ lives

unsigned Player::lives = 3

player life points

Definition at line 24 of file player.h.

◆ score

unsigned Player::score =0

player's personal score

Definition at line 39 of file player.h.

◆ x

unsigned Player::x

x coordinate of the player

Definition at line 29 of file player.h.


The documentation for this struct was generated from the following files: