ELEC2645 (2018/19) / Mbed 2 deprecated el17apb

Dependencies:   mbed Gamepad N5110

Embed: (wiki syntax)

« Back to documentation index

Blockhead Class Reference

Blockhead Class Reference

Blockhead Class. More...

#include <Blockhead.h>

Public Member Functions

 Blockhead ()
 Constructor.
 ~Blockhead ()
 Deconstructor.
void init ()
 initialises all variables for new game
void continue_init ()
 initialises variables for continue game (does not intialise level)
int next_level ()
 changes level when character reaches side of screen
void blockhead (Pos pos, N5110 &lcd, Gamepad &pad)
 controlls blockhead depending on position in game, and user input
int gameover_flag (Gamepad &pad)
 retruns 1 when gameover occurs

Detailed Description

Blockhead Class.

Class for controlling the main mechanics of the Blockhead character

Author:
Adam P. Baker
Date:
9 May 2019

Definition at line 16 of file Blockhead.h.


Constructor & Destructor Documentation

Blockhead (  )

Constructor.

Definition at line 7 of file Blockhead.cpp.

~Blockhead (  )

Deconstructor.

Definition at line 12 of file Blockhead.cpp.


Member Function Documentation

void blockhead ( Pos  pos,
N5110 &  lcd,
Gamepad &  pad 
)

controlls blockhead depending on position in game, and user input

Parameters:
posstruct which contains cordinates and direction of moving platforms
N5110class which controlls lcd screen
Gamepadclass for working with the gamepad

Definition at line 63 of file Blockhead.cpp.

void continue_init (  )

initialises variables for continue game (does not intialise level)

Definition at line 38 of file Blockhead.cpp.

int gameover_flag ( Gamepad &  pad )

retruns 1 when gameover occurs

Parameters:
Gamepadclass for working with the gamepad
Returns:
gameover (0 when alive, 1 once died) (int)

Definition at line 92 of file Blockhead.cpp.

void init (  )

initialises all variables for new game

Definition at line 19 of file Blockhead.cpp.

int next_level (  )

changes level when character reaches side of screen

Returns:
level blockhead is on (int)

Definition at line 527 of file Blockhead.cpp.