Yufan Zhong / Mbed 2 deprecated GOLD_MINER

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Winch Class Reference

Winch Class Reference

Winch Class. More...

#include <Winch.h>

Public Member Functions

 Winch ()
 Constructor.
 ~Winch ()
 Destructor.
void init (int height, int width)
 Initialise the winch.
void draw (N5110 &lcd)
 Draw the winch on the screen.
void update (Direction d, float mag)
 Update data.
void add_highest_score ()
 Add highest score.
int get_highest_score ()
 Get highest score.
Vector2D get_pos ()
 Get position of the winch.
void set_pos (Vector2D p)
 Set position of the winch.
float get_speed ()
 Get the speed of the winch.

Detailed Description

Winch Class.

Controls the winch in the gold miner game

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

Definition at line 14 of file Winch.h.


Constructor & Destructor Documentation

Winch (  )

Constructor.

Definition at line 4 of file Winch.cpp.

~Winch (  )

Destructor.

Definition at line 8 of file Winch.cpp.


Member Function Documentation

void add_highest_score (  )

Add highest score.

Definition at line 58 of file Winch.cpp.

void draw ( N5110 lcd )

Draw the winch on the screen.

Parameters:
lcd- N5110 library

Definition at line 26 of file Winch.cpp.

int get_highest_score (  )

Get highest score.

Returns:
the highest score.

Definition at line 64 of file Winch.cpp.

Vector2D get_pos (  )

Get position of the winch.

Returns:
the position of the winch.

Definition at line 70 of file Winch.cpp.

float get_speed (  )

Get the speed of the winch.

Returns:
the speed of the winch.

Definition at line 82 of file Winch.cpp.

void init ( int  height,
int  width 
)

Initialise the winch.

Parameters:
height- the height of the winch
width- the width of the winch

Definition at line 14 of file Winch.cpp.

void set_pos ( Vector2D  p )

Set position of the winch.

Parameters:
p- position of the winch

Definition at line 76 of file Winch.cpp.

void update ( Direction  d,
float  mag 
)

Update data.

Parameters:
d- direction of the joystick
mag- magnitude of the joystick

Definition at line 38 of file Winch.cpp.