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
Ship/Ship.h
- Committer:
- josh_ohara
- Date:
- 2020-05-12
- Revision:
- 21:970807533b10
- Parent:
- 20:0b6f1cfc5be6
- Child:
- 25:823b1a997a0c
File content as of revision 21:970807533b10:
#ifndef SHIP_H
#define SHIP_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "BulletS.h"
class Ship
{
public:
Ship();
~Ship();
void init(int height, int width); //dimensions of the ship without shooter, y position is bottom of the screen
void render(N5110 &lcd); //Draws basic rectangle ship
Vector2D get_position(); //Returns position of ship
void update(Direction d, float mag, Gamepad &pad, N5110 &lcd, int counter); //Interface between joystick and ship control
int get_height();
int get_width();
void set_life(bool life);
bool get_life();
vector<Bullet> get_bullet_vector();
void set_bullet_hit(int i, bool hit);
private:
int Height;
int Width;
int X;
int Y; //y value of ship
int Speed; //speed of ship
bool Life;
BulletS ship_bullet_vector;
};
#endif