Yufan Zhong / Mbed 2 deprecated GOLD_MINER

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Monster Class Reference

Monster Class Reference

Monster Class. More...

#include <Monster.h>

Public Member Functions

 Monster ()
 Constructor.
 ~Monster ()
 Destructor.
void init (float speed)
 Initialise the monster.
void draw (N5110 &lcd)
 Draw the monster.
void update ()
 Update the data.
void set_pos (int x)
 Set the position of the monster.
int get_pos ()
 Get the position of the monster.
void set_speed (float speed)
 Set the speed of the monster.
float get_speed ()
 Get the speed of monster.

Detailed Description

Monster Class.

Controls the monster in the gold miner game

Author:
Yufan Zhong, University of Leeds and SWJTU
Date:
May 2020

Definition at line 14 of file Monster.h.


Constructor & Destructor Documentation

Monster (  )

Constructor.

Definition at line 4 of file Monster.cpp.

~Monster (  )

Destructor.

Definition at line 8 of file Monster.cpp.


Member Function Documentation

void draw ( N5110 lcd )

Draw the monster.

Parameters:
lcd- N5110 library

Definition at line 21 of file Monster.cpp.

int get_pos (  )

Get the position of the monster.

Returns:
the position of the monster.

Definition at line 41 of file Monster.cpp.

float get_speed (  )

Get the speed of monster.

Returns:
the speed of the monster

Definition at line 52 of file Monster.cpp.

void init ( float  speed )

Initialise the monster.

Parameters:
speed- the speed of monster

Definition at line 14 of file Monster.cpp.

void set_pos ( int  x )

Set the position of the monster.

Parameters:
theposition of the monster.

Definition at line 36 of file Monster.cpp.

void set_speed ( float  speed )

Set the speed of the monster.

Parameters:
speed- the speed of monster

Definition at line 47 of file Monster.cpp.

void update (  )

Update the data.

Definition at line 27 of file Monster.cpp.