ELEC2645 (2018/19) / Mbed 2 deprecated el17apb

Dependencies:   mbed Gamepad N5110

Embed: (wiki syntax)

« Back to documentation index

BlockheadEngine Class Reference

BlockheadEngine Class Reference

BlockheadEngine Class. More...

#include <BlockheadEngine.h>

Public Member Functions

 BlockheadEngine ()
 Constructor.
 ~BlockheadEngine ()
 Deconstructor.
void init ()
 Initialises variables in blockhead class and level class and _pos struct.
void continue_init ()
 Intialises variables in blockhead class and level class and _pos struck (except level number which it keeps the same)
int playgame (N5110 &lcd, Gamepad &pad)
 runs the game 'blockhead'
int highscore ()
 sets highscore if new highest level reached

Detailed Description

BlockheadEngine Class.

Class for running the game

Author:
Adam P. Baker
Date:
9 May 2019

Definition at line 16 of file BlockheadEngine.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 7 of file BlockheadEngine.cpp.

Deconstructor.

Definition at line 12 of file BlockheadEngine.cpp.


Member Function Documentation

void continue_init (  )

Intialises variables in blockhead class and level class and _pos struck (except level number which it keeps the same)

Definition at line 29 of file BlockheadEngine.cpp.

int highscore (  )

sets highscore if new highest level reached

Returns:
_highscore (int)

Definition at line 55 of file BlockheadEngine.cpp.

void init (  )

Initialises variables in blockhead class and level class and _pos struct.

Definition at line 19 of file BlockheadEngine.cpp.

int playgame ( N5110 &  lcd,
Gamepad &  pad 
)

runs the game 'blockhead'

Parameters:
N5110class which controlls lcd screen
Gamepadclass for working with the gamepad
Returns:
_gameover (0 when blockhead alive, 1 once died) (int)

Definition at line 39 of file BlockheadEngine.cpp.