ELEC2645 (2018/19) / Mbed 2 deprecated el17set_

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Coin Class Reference

Coin Class Reference

Coin class. More...

#include <Coin.h>

Public Member Functions

void init (int x, int y)
 Init.
int get_x_coin ()
 Get x.
int get_y_coin ()
 Get y.
int get_coins ()
 Get coins.
void drawSprite (N5110 &lcd)
 Draw coin.
bool collidePlayer (int x, int y, Gamepad &pad)
 Coin collision.
void spawn (int x, int y, N5110 &lcd, Gamepad &pad)
 Coin collision.

Detailed Description

Coin class.

Class of the collectable coin

Version:
1.0
Author:
Spencer Tingle
Date:
09/05/19

Definition at line 26 of file Coin.h.


Member Function Documentation

bool collidePlayer ( int  x,
int  y,
Gamepad pad 
)

Coin collision.

Parameters:
x,y,padDetects collsions and plays tone when true

Definition at line 41 of file Coin.cpp.

void drawSprite ( N5110 lcd )

Draw coin.

Parameters:
lcdDraws the coin sprite

Definition at line 36 of file Coin.cpp.

int get_coins (  )

Get coins.

Gets the current number of coins collected

Definition at line 31 of file Coin.cpp.

int get_x_coin (  )

Get x.

Gets the coin's current x-coordinate

Definition at line 20 of file Coin.cpp.

int get_y_coin (  )

Get y.

Gets the coin's current y-coordinate

Definition at line 25 of file Coin.cpp.

void init ( int  x,
int  y 
)

Init.

Parameters:
x,yInitiates coordinates of coins

Definition at line 14 of file Coin.cpp.

void spawn ( int  x,
int  y,
N5110 lcd,
Gamepad pad 
)

Coin collision.

Parameters:
x,y,lcd,padDetects collsions and plays tone when true

Definition at line 65 of file Coin.cpp.