ELEC2645 (2018/19) / Mbed 2 deprecated el17set_

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Baby Class Reference

Baby Class Reference

Baby class. More...

#include <Baby.h>

Public Member Functions

void init (int x, int y)
 Init.
int get_x_char ()
 Get x.
int get_y_char ()
 Get y.
void drawSprite (N5110 &lcd)
 Draw baby.
void movement (Direction dir, N5110 &lcd)
 Moves baby.
bool northCollision (int x, int y, N5110 &lcd)
 North collsision.
bool southCollision (int x, int y, N5110 &lcd)
 South collsision.
bool eastCollision (int x, int y, N5110 &lcd)
 East collsision.
bool westCollision (int x, int y, N5110 &lcd)
 West collsision.

Detailed Description

Baby class.

Class of the controllable player

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

Definition at line 31 of file Baby.h.


Member Function Documentation

void drawSprite ( N5110 lcd )

Draw baby.

Parameters:
lcdDraws the baby sprite

Definition at line 28 of file Baby.cpp.

bool eastCollision ( int  x,
int  y,
N5110 lcd 
)

East collsision.

Parameters:
x,y,lcdDetects if baby sprite is colliding on east side

Definition at line 69 of file Baby.cpp.

int get_x_char (  )

Get x.

Gets the baby's current x-coordinate

Definition at line 18 of file Baby.cpp.

int get_y_char (  )

Get y.

Gets the baby's current y-coordinate

Definition at line 23 of file Baby.cpp.

void init ( int  x,
int  y 
)

Init.

Parameters:
x,yInitiates coordinates of baby

Definition at line 13 of file Baby.cpp.

void movement ( Direction  dir,
N5110 lcd 
)

Moves baby.

Parameters:
dir,lcdMoves the baby sprite

Definition at line 33 of file Baby.cpp.

bool northCollision ( int  x,
int  y,
N5110 lcd 
)

North collsision.

Parameters:
x,y,lcdDetects if baby sprite is colliding on north side

Definition at line 49 of file Baby.cpp.

bool southCollision ( int  x,
int  y,
N5110 lcd 
)

South collsision.

Parameters:
x,y,lcdDetects if baby sprite is colliding on south side

Definition at line 59 of file Baby.cpp.

bool westCollision ( int  x,
int  y,
N5110 lcd 
)

West collsision.

Parameters:
x,y,lcdDetects if baby sprite is colliding on west side

Definition at line 79 of file Baby.cpp.