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
SpaceRebEngine Class Reference
SpaceRebEngine class. More...
#include <SpaceRebEngine.h>
| Public Member Functions | |
| SpaceRebEngine () | |
| constructor | |
| ~SpaceRebEngine () | |
| destructor | |
| void | init (int spaceinvader_width, int spaceinvader_height, int missiles_size, int speed) | 
| Initialises spaceinvader and missiles. | |
| void | read_input (Gamepad &pad) | 
| Sets joystick values. | |
| void | update (Gamepad &pad) | 
| Updates joystick and missiles values. | |
| void | draw (N5110 &lcd) | 
| Draws game. | |
| void | print_scores (N5110 &lcd) | 
| Sets score and prints score. | |
| void | check_spaceinvader_collision (Gamepad &pad) | 
| Sets value of _end. | |
| void | check_wall_collision (Gamepad &pad) | 
| Sets missiles velocity. | |
| bool | game_end () | 
| Gets value of end. | |
Detailed Description
SpaceRebEngine class.
Class for Space Rebellion Engine
- Version:
- 1.0
- Date:
- May 2019
Definition at line 22 of file SpaceRebEngine.h.
Constructor & Destructor Documentation
| SpaceRebEngine | ( | ) | 
constructor
Definition at line 3 of file SpaceRebEngine.cpp.
| ~SpaceRebEngine | ( | ) | 
destructor
Definition at line 8 of file SpaceRebEngine.cpp.
Member Function Documentation
| void check_spaceinvader_collision | ( | Gamepad & | pad ) | 
Sets value of _end.
- Parameters:
- 
  value of _end 
Returns the boolean value of _end
Definition at line 84 of file SpaceRebEngine.cpp.
| void check_wall_collision | ( | Gamepad & | pad ) | 
Sets missiles velocity.
- Parameters:
- 
  sets velocity values of missiles 
Sets the values for velocity.x & velocity.y of missiles
Definition at line 47 of file SpaceRebEngine.cpp.
| void draw | ( | N5110 & | lcd ) | 
Draws game.
- Returns:
- draw game components
Draws spaceinvader, missiles & play area
Definition at line 31 of file SpaceRebEngine.cpp.
| bool game_end | ( | ) | 
Gets value of end.
- Returns:
- value of end
Returns the boolean value of end
Definition at line 108 of file SpaceRebEngine.cpp.
| void init | ( | int | spaceinvader_width, | 
| int | spaceinvader_height, | ||
| int | missiles_size, | ||
| int | speed | ||
| ) | 
Initialises spaceinvader and missiles.
- Parameters:
- 
  sets spaceinvader 
Sets height and width of the spaceinvader private variables
- Parameters:
- 
  sets missiles 
Sets size and speed of the missiles private variables
Definition at line 13 of file SpaceRebEngine.cpp.
| void print_scores | ( | N5110 & | lcd ) | 
Sets score and prints score.
- Parameters:
- 
  sets the score value 
Sets the value of _score private variable
- Returns:
- prints value of score
Prints the score on the lcd display
Definition at line 100 of file SpaceRebEngine.cpp.
| void read_input | ( | Gamepad & | pad ) | 
Sets joystick values.
- Parameters:
- 
  sets the joystick values 
Sets direction and magnitude of the joystick private variables
Definition at line 25 of file SpaceRebEngine.cpp.
| void update | ( | Gamepad & | pad ) | 
Updates joystick and missiles values.
- Parameters:
- 
  sets the joystick values 
Sets direction and magnitude of the joystick private variables
- Parameters:
- 
  sets missiles 
Sets size and speed of the missiles private variables
Definition at line 38 of file SpaceRebEngine.cpp.
Generated on Thu Jul 14 2022 11:01:22 by
 1.7.2
 1.7.2