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
Weapons/Weapons.h@14:88ca5b1a111a, 2019-04-10 (annotated)
- Committer:
- ikenna1
- Date:
- Wed Apr 10 18:50:17 2019 +0000
- Revision:
- 14:88ca5b1a111a
- Parent:
- 9:241a1a7d8527
- Child:
- 22:8cad70085883
* made changes to imperions' weapons by adding delays;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ikenna1 | 9:241a1a7d8527 | 1 | #ifndef WEAPONS_H |
ikenna1 | 9:241a1a7d8527 | 2 | #define WEAPONS_H |
ikenna1 | 9:241a1a7d8527 | 3 | |
ikenna1 | 9:241a1a7d8527 | 4 | #include "mbed.h" |
ikenna1 | 9:241a1a7d8527 | 5 | #include "N5110.h" |
ikenna1 | 9:241a1a7d8527 | 6 | #include "Gamepad.h" |
ikenna1 | 9:241a1a7d8527 | 7 | #include "Ship.h" |
ikenna1 | 9:241a1a7d8527 | 8 | |
ikenna1 | 9:241a1a7d8527 | 9 | class Weapons |
ikenna1 | 9:241a1a7d8527 | 10 | { |
ikenna1 | 9:241a1a7d8527 | 11 | public: |
ikenna1 | 9:241a1a7d8527 | 12 | Weapons(); |
ikenna1 | 9:241a1a7d8527 | 13 | ~Weapons(); |
ikenna1 | 9:241a1a7d8527 | 14 | |
ikenna1 | 9:241a1a7d8527 | 15 | /* Initialize the class with the ship position */ |
ikenna1 | 9:241a1a7d8527 | 16 | void init(int ship_xpos, int ship_ypos, int ship_width); |
ikenna1 | 9:241a1a7d8527 | 17 | |
ikenna1 | 9:241a1a7d8527 | 18 | /* Draw the missle */ |
ikenna1 | 9:241a1a7d8527 | 19 | void draw(N5110 &lcd); |
ikenna1 | 14:88ca5b1a111a | 20 | void draw_i(N5110 &lcd); |
ikenna1 | 9:241a1a7d8527 | 21 | |
ikenna1 | 9:241a1a7d8527 | 22 | /* Gets the projectiles position */ |
ikenna1 | 9:241a1a7d8527 | 23 | Vector2D get_pos(); |
ikenna1 | 9:241a1a7d8527 | 24 | |
ikenna1 | 9:241a1a7d8527 | 25 | /* Moves the projectile across the screen */ |
ikenna1 | 9:241a1a7d8527 | 26 | void update(); |
ikenna1 | 9:241a1a7d8527 | 27 | int ship_xpos; |
ikenna1 | 9:241a1a7d8527 | 28 | int ship_ypos; |
ikenna1 | 9:241a1a7d8527 | 29 | int _ship_xpos; |
ikenna1 | 9:241a1a7d8527 | 30 | int _ship_ypos; |
ikenna1 | 9:241a1a7d8527 | 31 | |
ikenna1 | 9:241a1a7d8527 | 32 | /** Set Position |
ikenna1 | 9:241a1a7d8527 | 33 | * |
ikenna1 | 9:241a1a7d8527 | 34 | * This function is used to set the position of the projectile to a specific coordinate on screen. |
ikenna1 | 9:241a1a7d8527 | 35 | */ |
ikenna1 | 9:241a1a7d8527 | 36 | void set_pos(Vector2D p); |
ikenna1 | 9:241a1a7d8527 | 37 | |
ikenna1 | 9:241a1a7d8527 | 38 | private: |
ikenna1 | 9:241a1a7d8527 | 39 | int reset; |
ikenna1 | 9:241a1a7d8527 | 40 | Vector2D _velocity; |
ikenna1 | 9:241a1a7d8527 | 41 | int _size; |
ikenna1 | 9:241a1a7d8527 | 42 | int _x; |
ikenna1 | 9:241a1a7d8527 | 43 | int _y; |
ikenna1 | 9:241a1a7d8527 | 44 | |
ikenna1 | 9:241a1a7d8527 | 45 | }; |
ikenna1 | 9:241a1a7d8527 | 46 | #endif |