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
Rocket/Rocket.h
- Committer:
- RehamFaqehi
- Date:
- 2018-05-07
- Revision:
- 15:658f1216ee84
- Parent:
- 12:4d7f1349d796
File content as of revision 15:658f1216ee84:
#ifndef ROCKET_H
#define ROCKET_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
/** Rocket Class
* @brief class create the rocket
* @author Reham Faqehi
* @date May, 2018 */
class Rocket
{
public:
/** Constructor */
Rocket();
/** Destructor */
~Rocket();
/** Initialise the rocket position,
* speed and number of collisions.
*/
void init();
/** Draw sprite for the Rocket shape
* @param LCD object (N5110)
*/
void draw(N5110 &lcd);
/** Update the rocket movements
* @param Direction d and magnitude (float)
*/
void update(Direction d,float mag);
/** Get the rocket position
* @return the current position
*/
Vector2D get_pos();
/** Increase the number of
* collisions
*/
void add_collisions();
/** Get the number of
* collisions
* @return the current collision number
*/
int get_collisions();
/** Draw sprite for 3 hearts
* @param LCD object (N5110)
*/
void drawFullHearts(N5110 &lcd);
/** Draw sprite for 2 hearts only
* @param LCD object (N5110)
*/
void drawTwoHearts(N5110 &lcd);
/** Draw sprite for 1 heart only
* @param LCD object (N5110)
*/
void drawOneHeart(N5110 &lcd);
private:
int _x;
int _y;
int _speed;
Vector2D p;
int _collision;
};
#endif