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
SpaceInvadersEngine/SpaceInvadersEngine.h
- Committer:
- fy14lkaa
- Date:
- 2019-04-26
- Revision:
- 56:c8fc0a1f4132
- Parent:
- 54:095eae44895b
- Child:
- 57:45c5de9cefdf
File content as of revision 56:c8fc0a1f4132:
#ifndef SPACEINVADERSENGINE_H
#define SPACEINVADERSENGINE_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Alien.h"
#include "bullet.h"
// gap from edge of screen
#define GAP 2
class SpaceInvadersEngine
{
public:
SpaceInvadersEngine();
~SpaceInvadersEngine();
void init(int space_ship_width,int space_ship_height,int bullet_size, int Alien_size,int speed);
void read_input(Gamepad &pad);
void update(Gamepad &pad);
void draw(N5110 &lcd);
private:
void check_wall_collision(Gamepad &pad);
void space_ship_collisions(Gamepad &pad);
void check_goal(Gamepad &pad);
void print_scores(N5110 &lcd);
Alien _A1;
int _space_ship_width;
int _space_ship_height;
int _bullet_size;
int _alien_size;
int _speed;
Direction _d;
float _mag;
};
#endif