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
Spikes Class Reference
#include <Spikes.h>
Public Member Functions | |
| Spikes () | |
| Constructor.   | |
| ~Spikes () | |
| Destructor.   | |
| void | init () | 
| Initalises Spikes.   | |
| void | draw (N5110 &lcd) | 
| Draws the first type of spike.   | |
| void | draw2 (N5110 &lcd) | 
| Draws the second type of spike.   | |
| void | draw3 (N5110 &lcd) | 
| Draws the third type of spike.   | |
| void | updatey () | 
| update the y direction   | |
| void | updatex () | 
| update the x direction   | |
| void | updatexn () | 
| update the x direction negatively   | |
| void | position (int x) | 
| set initial random position of a spike   | |
| void | set_pos (int x, int y) | 
| set co ordinates of sprite   | |
| Vector2D | get_pos () | 
| gets co-ordinates of the sprite @ return position vector   | |
| void | hit (Gamepad &pad) | 
| set co ordinates of sprite   | |
Detailed Description
Spikes class.
falling sprites to be avoided
- Date:
 - May 2020
 
Definition at line 16 of file Spikes.h.
Constructor & Destructor Documentation
| Spikes | ( | ) | 
Constructor.
Definition at line 30 of file Spikes.cpp.
| ~Spikes | ( | ) | 
Destructor.
Definition at line 35 of file Spikes.cpp.
Member Function Documentation
| void draw | ( | N5110 & | lcd ) | 
Draws the first type of spike.
- Parameters:
 - 
  
lcd N5110 object  
Definition at line 50 of file Spikes.cpp.
| void draw2 | ( | N5110 & | lcd ) | 
Draws the second type of spike.
- Parameters:
 - 
  
lcd N5110 object  
Definition at line 56 of file Spikes.cpp.
| void draw3 | ( | N5110 & | lcd ) | 
Draws the third type of spike.
- Parameters:
 - 
  
lcd N5110 object  
Definition at line 62 of file Spikes.cpp.
| Vector2D get_pos | ( | ) | 
gets co-ordinates of the sprite @ return position vector
Definition at line 107 of file Spikes.cpp.
| void hit | ( | Gamepad & | pad ) | 
| void init | ( | ) | 
Initalises Spikes.
Definition at line 40 of file Spikes.cpp.
| void position | ( | int | x ) | 
set initial random position of a spike
- Parameters:
 - 
  
int x @ details 1-4 determines general section of screen  
Definition at line 69 of file Spikes.cpp.
| void set_pos | ( | int | x, | 
| int | y | ||
| ) | 
| void updatex | ( | ) | 
update the x direction
Definition at line 96 of file Spikes.cpp.
| void updatexn | ( | ) | 
update the x direction negatively
Definition at line 101 of file Spikes.cpp.
| void updatey | ( | ) | 
update the y direction
Definition at line 91 of file Spikes.cpp.
Generated on Tue Jul 12 2022 18:29:13 by
 1.7.2