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
Diff: Weapons/Weapons.h
- Revision:
- 9:241a1a7d8527
- Child:
- 14:88ca5b1a111a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Weapons/Weapons.h Tue Apr 09 05:14:07 2019 +0000 @@ -0,0 +1,45 @@ +#ifndef WEAPONS_H +#define WEAPONS_H + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" +#include "Ship.h" + +class Weapons +{ + public: + Weapons(); + ~Weapons(); + + /* Initialize the class with the ship position */ + void init(int ship_xpos, int ship_ypos, int ship_width); + + /* Draw the missle */ + void draw(N5110 &lcd); + + /* Gets the projectiles position */ + Vector2D get_pos(); + + /* Moves the projectile across the screen */ + void update(); + int ship_xpos; + int ship_ypos; + int _ship_xpos; + int _ship_ypos; + + /** Set Position + * + * This function is used to set the position of the projectile to a specific coordinate on screen. + */ + void set_pos(Vector2D p); + + private: + int reset; + Vector2D _velocity; + int _size; + int _x; + int _y; + +}; +#endif \ No newline at end of file