Reham Faqehi / Mbed 2 deprecated fy15raf

Dependencies:   mbed

Fork of fy15raf by ELEC2645 (2017/18)

Embed: (wiki syntax)

« Back to documentation index

GameEngine Class Reference

GameEngine Class Reference

GameEngine Class. More...

#include <GameEngine.h>

Public Member Functions

 GameEngine ()
 Constructor.
 ~GameEngine ()
 Destructor.
void init ()
 Initialise the game elements: Spaceship, asteroids, time, and game over value.
void read_input (Gamepad &g_pad)
 Read the direction and magnitude data from the joystick.
void draw (N5110 &lcd)
 Draw the game elements: Spaceship, asteroids, hearts and show the time.
void update (Gamepad &pad)
 Update the game elements: Spaceship, asteroids, the hearts and the time.
void draw_hearts (N5110 &lcd)
 Draw the hearts.
int check_gameOver ()
 Check if it is the end of the game.
void print_time (N5110 &lcd)
 Print the current time in sec.
void time_increment ()
 Increase the time every 1 sec.
void time_stop ()
 Stop the time counter at the end of the game.
void print_travel_time (N5110 &lcd)
 Print the total time in sec at the end of the game.
void reset_gameOver ()
 Reset the time and game over value to play again.

Detailed Description

GameEngine Class.

class to control the game functions

Author:
Reham Faqehi
Date:
May, 2018

Definition at line 15 of file GameEngine.h.


Constructor & Destructor Documentation

GameEngine (  )

Constructor.

Definition at line 3 of file GameEngine.cpp.

~GameEngine (  )

Destructor.

Definition at line 8 of file GameEngine.cpp.


Member Function Documentation

int check_gameOver (  )

Check if it is the end of the game.

Returns:
the gameover value (int)

Definition at line 161 of file GameEngine.cpp.

void draw ( N5110 lcd )

Draw the game elements: Spaceship, asteroids, hearts and show the time.

Parameters:
LCDobject (N5110)

Definition at line 33 of file GameEngine.cpp.

void draw_hearts ( N5110 lcd )

Draw the hearts.

Parameters:
LCDobject (N5110)

Definition at line 139 of file GameEngine.cpp.

void init (  )

Initialise the game elements: Spaceship, asteroids, time, and game over value.

Definition at line 14 of file GameEngine.cpp.

void print_time ( N5110 lcd )

Print the current time in sec.

Parameters:
LCDobject (N5110)

Definition at line 192 of file GameEngine.cpp.

void print_travel_time ( N5110 lcd )

Print the total time in sec at the end of the game.

Parameters:
LCDobject (N5110)

Definition at line 201 of file GameEngine.cpp.

void read_input ( Gamepad g_pad )

Read the direction and magnitude data from the joystick.

Parameters:
gamepadobject (Gamepad)

Definition at line 26 of file GameEngine.cpp.

void reset_gameOver (  )

Reset the time and game over value to play again.

Definition at line 169 of file GameEngine.cpp.

void time_increment (  )

Increase the time every 1 sec.

Definition at line 177 of file GameEngine.cpp.

void time_stop (  )

Stop the time counter at the end of the game.

Definition at line 185 of file GameEngine.cpp.

void update ( Gamepad pad )

Update the game elements: Spaceship, asteroids, the hearts and the time.

Parameters:
gamepadobject (Gamepad)

Definition at line 49 of file GameEngine.cpp.