Nemesis game, stats

Embed: (wiki syntax)

« Back to documentation index

Stats Class Reference

Stats Class Reference

Friendly Class. More...

#include <Stats.h>

Public Member Functions

 Stats ()
 Constructors and destructors:
void draw_grid (N5110 &lcd)
 Draw Grid.
void draw_wave_counter (N5110 &lcd, int wave_counter)
 Draw Wave Counter.
void draw_health (N5110 &lcd)
 Draw Health.
void draw_rocket1 (N5110 &lcd, int state)
 Draw First Rocket.
void draw_rocket2 (N5110 &lcd, int state)
 Draw Second Rocket.
void draw_rocket3 (N5110 &lcd, int state)
 Draw Third Rocket.
void draw_star (N5110 &lcd, int state)
 Draw Star.
void check_health_high (N5110 &lcd, int collisions)
 Check Health (high)
void check_health_low (N5110 &lcd, int collisions)
 Check Health (low)
void check_rocket (N5110 &lcd, int ammo)
 Check Rocket.
void check_star (N5110 &lcd, bool star)
 Check Star.

Detailed Description

Friendly Class.

Used for drawing the weapons bar, the health bar, and the wave counter in the Nemesis game. Constantly checks and redraws elements based on user input and progress in the game. Incorporates N5110.h file by Craig A. Evans.

Revision 1.0

Author:
Musallam M. M. Bseiso
Date:
3rd May 2017

Definition at line 21 of file Stats.h.


Constructor & Destructor Documentation

Stats (  )

Constructors and destructors:

Definition at line 3 of file Stats.cpp.


Member Function Documentation

void check_health_high ( N5110 &  lcd,
int  collisions 
)

Check Health (high)

Draws the health bars onto the LCD depending on how much health the player has (depending on the variable "collisons"). If zero collisions, health bar is full, i.e the heart is filled black. As collisions increase, the health bar goes down, i.e less of the heart is filled black. This method only deals with the health when it is high.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library
collisions- variable that stores how many collisions have been registered

Definition at line 108 of file Stats.cpp.

void check_health_low ( N5110 &  lcd,
int  collisions 
)

Check Health (low)

Draws the health bars onto the LCD depending on how much health the player has (depending on the variable "collisons"). If zero collisions, health bar is full, i.e the heart is filled black. As collisions increase, the health bar goes down, i.e less of the heart is filled black. This method only deals with the health when it is low.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library
collisions- variable that stores how many collisions have been registered

Definition at line 131 of file Stats.cpp.

void check_rocket ( N5110 &  lcd,
int  ammo 
)

Check Rocket.

Draws the rockets in the weapons bar onto the LCD depending on how many the player has (depending on the variable "ammo"). If full ammo, all 3 rockets are drawn full black, i.e drawn with the state set to 1. After one shot (ammo = 2), the first two are still drawn full black and the third one is drawn dotted, i.e the first two are drawn with a state of 1, and the third one is drawn with a state of 2, etc.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library
ammo- variable that stores how many rockets are available

Definition at line 154 of file Stats.cpp.

void check_star ( N5110 &  lcd,
bool  star 
)

Check Star.

Draws the star in the weapons bar onto the LCD depending on if the player has one available (depending on the variable "star"). If "star" is set to true, it is drawn full black, i.e drawn with the state set to 1, if it is set to false, it is drawn dotted, i.e drawn with the state set to 2.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library
star- variable that stores whether a star is available or not

Definition at line 179 of file Stats.cpp.

void draw_grid ( N5110 &  lcd )

Draw Grid.

Draws the outer rectangular border, health border, wave counter border, and weapon border onto the LCD.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library

Definition at line 14 of file Stats.cpp.

void draw_health ( N5110 &  lcd )

Draw Health.

Draws the outside border of the health bar heart onto the LCD.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library

Definition at line 36 of file Stats.cpp.

void draw_rocket1 ( N5110 &  lcd,
int  state 
)

Draw First Rocket.

Draws the first rocket from the left in the weapons bar onto the LCD. It is drawn full black or dotted depending on the "state" variable. Further explained in the "check_rocket" method.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library
state- variable that determines if line is drawn full black (1) or dotted (2)

Definition at line 53 of file Stats.cpp.

void draw_rocket2 ( N5110 &  lcd,
int  state 
)

Draw Second Rocket.

Draws the second rocket from the left in the weapons bar onto the LCD. It is drawn full black or dotted depending on the "state" variable. Further explained in the "check_rocket" method.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library
state- variable that determines if line is drawn full black (1) or dotted (2)

Definition at line 66 of file Stats.cpp.

void draw_rocket3 ( N5110 &  lcd,
int  state 
)

Draw Third Rocket.

Draws the third rocket from the left in the weapons bar onto the LCD. It is drawn full black or dotted depending on the "state" variable. Further explained in the "check_rocket" method.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library
state- variable that determines if line is drawn full black (1) or dotted (2)

Definition at line 79 of file Stats.cpp.

void draw_star ( N5110 &  lcd,
int  state 
)

Draw Star.

Draws the star onto the LCD. It is drawn full black or dotted depending on the "state" variable. Further explained in the "check_rocket" method.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library
state- variable that determines if line is drawn full black (1) or dotted (2)

Definition at line 92 of file Stats.cpp.

void draw_wave_counter ( N5110 &  lcd,
int  wave_counter 
)

Draw Wave Counter.

Draws the wave counter onto the LCD.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library
wave_counter- counter that stores which wave the game is in

Definition at line 26 of file Stats.cpp.