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.
Dependencies: mbed
SpaceInvader Class Reference
SpaceInvader class. More...
#include <SpaceInvader.h>
Public Member Functions | |
| SpaceInvader () | |
| constructor | |
| ~SpaceInvader () | |
| destructor | |
| void | init (int height, int width) |
| Sets spaceinvader starting position and speed. | |
| void | draw (N5110 &lcd) |
| Draw the spaceinvader. | |
| void | update (Direction d, float mag) |
| Updates the position of the spaceinvader. | |
| Vector2D | get_pos () |
| Gets the position. | |
Detailed Description
SpaceInvader class.
Class for Spaceinvader
- Version:
- 1.0
- Date:
- May 2019
Definition at line 20 of file SpaceInvader.h.
Constructor & Destructor Documentation
| SpaceInvader | ( | ) |
constructor
Definition at line 2 of file SpaceInvader.cpp.
| ~SpaceInvader | ( | ) |
destructor
Definition at line 7 of file SpaceInvader.cpp.
Member Function Documentation
| void draw | ( | N5110 & | lcd ) |
Draw the spaceinvader.
- Returns:
- draws spaceinvader
Uses designed sprite to draw a spaceinvader
Definition at line 21 of file SpaceInvader.cpp.
| Vector2D get_pos | ( | ) |
Gets the position.
- Returns:
- position
returns the position of both the x and y coordinates
Definition at line 74 of file SpaceInvader.cpp.
| void init | ( | int | height, |
| int | width | ||
| ) |
Sets spaceinvader starting position and speed.
- Parameters:
-
sets position and speed
Sets starting position and speed of the spaceinvader
Definition at line 12 of file SpaceInvader.cpp.
| void update | ( | Direction | d, |
| float | mag | ||
| ) |
Updates the position of the spaceinvader.
- Parameters:
-
sets position
Uses movement of joystick to set position of spaceinvader
Definition at line 36 of file SpaceInvader.cpp.
Generated on Thu Jul 14 2022 11:01:22 by
1.7.2