Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of fy15raf by
Spaceship Class Reference
#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
- 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:
-
LCD object (N5110)
Definition at line 22 of file Spaceship.cpp.
void drawFullHearts | ( | N5110 & | lcd ) |
Draw sprite for 3 hearts.
- Parameters:
-
LCD object (N5110)
Definition at line 84 of file Spaceship.cpp.
void drawOneHeart | ( | N5110 & | lcd ) |
Draw sprite for 1 heart only.
- Parameters:
-
LCD object (N5110)
Definition at line 110 of file Spaceship.cpp.
void drawTwoHearts | ( | N5110 & | lcd ) |
Draw sprite for 2 hearts only.
- Parameters:
-
LCD object (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:
-
Direction d and magnitude (float)
Definition at line 37 of file Spaceship.cpp.
Generated on Thu Jul 14 2022 18:15:41 by
