Reham Faqehi / Mbed 2 deprecated fy15raf

Dependencies:   mbed

Fork of fy15raf by ELEC2645 (2017/18)

Embed: (wiki syntax)

« Back to documentation index

Spaceship Class Reference

Spaceship Class Reference

Spaceship Class. More...

#include <Spaceship.h>

Public Member Functions

 Spaceship ()
 Constructor.
 ~Spaceship ()
 Destructor.
void init ()
 Initialise the Spaceship position, speed and number of collisions.
void draw (N5110 &lcd)
 Draw sprite for the Spaceship shape.
void update (Direction d, float mag)
 Update the Spaceship movements.
Vector2D get_pos ()
 Get the Spaceship position.
void add_collisions ()
 Increase the number of collisions.
int get_collisions ()
 Get the number of collisions.
void drawFullHearts (N5110 &lcd)
 Draw sprite for 3 hearts.
void drawTwoHearts (N5110 &lcd)
 Draw sprite for 2 hearts only.
void drawOneHeart (N5110 &lcd)
 Draw sprite for 1 heart only.

Detailed Description

Spaceship Class.

class create the Spaceship

Author:
Reham Faqehi
Date:
May, 2018

Definition at line 13 of file Spaceship.h.


Constructor & Destructor Documentation

Spaceship (  )

Constructor.

Definition at line 3 of file Spaceship.cpp.

~Spaceship (  )

Destructor.

Definition at line 8 of file Spaceship.cpp.


Member Function Documentation

void add_collisions (  )

Increase the number of collisions.

Definition at line 74 of file Spaceship.cpp.

void draw ( N5110 lcd )

Draw sprite for the Spaceship shape.

Parameters:
LCDobject (N5110)

Definition at line 22 of file Spaceship.cpp.

void drawFullHearts ( N5110 lcd )

Draw sprite for 3 hearts.

Parameters:
LCDobject (N5110)

Definition at line 84 of file Spaceship.cpp.

void drawOneHeart ( N5110 lcd )

Draw sprite for 1 heart only.

Parameters:
LCDobject (N5110)

Definition at line 110 of file Spaceship.cpp.

void drawTwoHearts ( N5110 lcd )

Draw sprite for 2 hearts only.

Parameters:
LCDobject (N5110)

Definition at line 97 of file Spaceship.cpp.

int get_collisions (  )

Get the number of collisions.

Returns:
the current collision number

Definition at line 79 of file Spaceship.cpp.

Vector2D get_pos (  )

Get the Spaceship position.

Returns:
the current position

Definition at line 68 of file Spaceship.cpp.

void init (  )

Initialise the Spaceship position, speed and number of collisions.

Definition at line 13 of file Spaceship.cpp.

void update ( Direction  d,
float  mag 
)

Update the Spaceship movements.

Parameters:
Directiond and magnitude (float)

Definition at line 37 of file Spaceship.cpp.