ELEC2645 (2018/19) / Mbed 2 deprecated el17ntkv

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Badman Class Reference

Badman Class Reference

Badman Class. More...

#include <Badman.h>

Public Member Functions

 Badman ()
 Default Badman object constructor.
 ~Badman ()
 Default Badman object destructor.
void init (int size)
 Mutator method initialises the badman character object setting it's radius and start position in the maze.
void draw (N5110 &lcd)
 Mutator method gets displays the badman character on the lcd screen dependent on it's current x and y coordinates and size.
Vector2D getPos ()
 Accessor method gets the current coordinates of the badman character object.
void setPos (int x, int y)
 Mutator method gets the current x and y coordinate of the badman object to the coordinate passed in the function call.
int getSize ()
 Accessor method gets the size of badman character object.

Detailed Description

Badman Class.

Author:
Mr Nigel TK Vere, University of Leeds Controls and models the badman main character for the badman game
Date:
April 2019 Badman Class

Controls and models the badman main character for the badman game

Version:
1.0
Author:
Mr Nigel TK Vere
Date:
April 2019

Definition at line 27 of file Badman.h.


Constructor & Destructor Documentation

Badman (  )

Default Badman object constructor.

Definition at line 5 of file Badman.cpp.

~Badman (  )

Default Badman object destructor.

Definition at line 9 of file Badman.cpp.


Member Function Documentation

void draw ( N5110 lcd )

Mutator method gets displays the badman character on the lcd screen dependent on it's current x and y coordinates and size.

Parameters:
lcdRefrence NOKIA 5110 LCD screen object

Definition at line 22 of file Badman.cpp.

Vector2D getPos (  )

Accessor method gets the current coordinates of the badman character object.

Returns:
Returns the Vector data type holding the current x and y coordinates of the badman character object's centre

Definition at line 27 of file Badman.cpp.

int getSize (  )

Accessor method gets the size of badman character object.

Returns:
Returns the size(radius ) of the badman character object

Definition at line 41 of file Badman.cpp.

void init ( int  size )

Mutator method initialises the badman character object setting it's radius and start position in the maze.

Parameters:
sizeInteger value giving the radius of our badman character object

Definition at line 14 of file Badman.cpp.

void setPos ( int  x,
int  y 
)

Mutator method gets the current x and y coordinate of the badman object to the coordinate passed in the function call.

Parameters:
xX coordinate value of the new position the badman character object is to move to
yY coordinate value of the new position the badman character object is to move to

Definition at line 34 of file Badman.cpp.