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
RosenEngine/RosenEngine.h@26:a53d41adf40b, 2019-04-18 (annotated)
- Committer:
- ikenna1
- Date:
- Thu Apr 18 11:40:47 2019 +0000
- Revision:
- 26:a53d41adf40b
- Parent:
- 25:faba9eb44514
- Child:
- 27:f99249e727fd
Changed the way collision functions work to now return a true or false value depending on if the collision occurred.;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ikenna1 | 2:66a4e5d7a7cd | 1 | #ifndef ROSENENGINE_H |
ikenna1 | 2:66a4e5d7a7cd | 2 | #define ROSENENGINE_H |
ikenna1 | 2:66a4e5d7a7cd | 3 | |
ikenna1 | 2:66a4e5d7a7cd | 4 | #include "mbed.h" |
ikenna1 | 2:66a4e5d7a7cd | 5 | #include "N5110.h" |
ikenna1 | 2:66a4e5d7a7cd | 6 | #include "Gamepad.h" |
ikenna1 | 7:ed5870cfb3e0 | 7 | #include "Ship.h" |
ikenna1 | 9:241a1a7d8527 | 8 | #include "Weapons.h" |
ikenna1 | 9:241a1a7d8527 | 9 | #include "Menu.h" |
ikenna1 | 15:009ccc07bb57 | 10 | #include "Enemy.h" |
ikenna1 | 17:e65a9f981834 | 11 | #include "Health.h" |
ikenna1 | 2:66a4e5d7a7cd | 12 | |
ikenna1 | 2:66a4e5d7a7cd | 13 | class RosenEngine |
ikenna1 | 2:66a4e5d7a7cd | 14 | { |
ikenna1 | 2:66a4e5d7a7cd | 15 | |
ikenna1 | 2:66a4e5d7a7cd | 16 | public: |
ikenna1 | 2:66a4e5d7a7cd | 17 | RosenEngine(); |
ikenna1 | 2:66a4e5d7a7cd | 18 | ~RosenEngine(); |
ikenna1 | 3:f9cd1a38d5c6 | 19 | |
ikenna1 | 8:87a845b8575e | 20 | void init(int ship_width,int ship_height,int ship_speed,int ship_xpos,int ship_ypos); |
ikenna1 | 2:66a4e5d7a7cd | 21 | void read_input(Gamepad &pad); |
ikenna1 | 2:66a4e5d7a7cd | 22 | void update(Gamepad &pad); |
ikenna1 | 14:88ca5b1a111a | 23 | void draw(N5110 &lcd, Gamepad &pad); |
ikenna1 | 9:241a1a7d8527 | 24 | void get_pos(); |
ikenna1 | 10:c33d7593a275 | 25 | void title(N5110 &lcd); |
ikenna1 | 13:e114d362186d | 26 | int get_ycursor(); |
ikenna1 | 21:628fb703188f | 27 | int get_shipno(); |
ikenna1 | 12:47578eb9ea73 | 28 | void ship_select(N5110 &lcd); |
ikenna1 | 9:241a1a7d8527 | 29 | |
ikenna1 | 9:241a1a7d8527 | 30 | int ship_xpos; |
ikenna1 | 9:241a1a7d8527 | 31 | int ship_ypos; |
ikenna1 | 9:241a1a7d8527 | 32 | int ship_width; |
ikenna1 | 25:faba9eb44514 | 33 | int ship_height; |
ikenna1 | 25:faba9eb44514 | 34 | //*** note: add ship width and ship heirgth in place of 6 and 9 to generalize arrays after they are finished |
ikenna1 | 10:c33d7593a275 | 35 | |
ikenna1 | 2:66a4e5d7a7cd | 36 | private: |
ikenna1 | 26:a53d41adf40b | 37 | bool ship_projectile_collision(); |
ikenna1 | 26:a53d41adf40b | 38 | bool enemy_ship_collision(); |
ikenna1 | 26:a53d41adf40b | 39 | bool enemy_projectile_collision(); |
ikenna1 | 4:740e14ebbc97 | 40 | |
ikenna1 | 4:740e14ebbc97 | 41 | // Variables |
ikenna1 | 8:87a845b8575e | 42 | Ship _ship; |
ikenna1 | 9:241a1a7d8527 | 43 | Weapons _weapons; |
ikenna1 | 9:241a1a7d8527 | 44 | Menu _menu; |
ikenna1 | 15:009ccc07bb57 | 45 | Enemy _enemy; |
ikenna1 | 17:e65a9f981834 | 46 | Health _health; |
ikenna1 | 4:740e14ebbc97 | 47 | float _xjoystick; |
ikenna1 | 4:740e14ebbc97 | 48 | float _yjoystick; |
ikenna1 | 9:241a1a7d8527 | 49 | Direction _d; |
ikenna1 | 10:c33d7593a275 | 50 | int _ycursor; |
ikenna1 | 21:628fb703188f | 51 | int _shipno; |
ikenna1 | 25:faba9eb44514 | 52 | |
ikenna1 | 2:66a4e5d7a7cd | 53 | |
ikenna1 | 2:66a4e5d7a7cd | 54 | }; |
ikenna1 | 25:faba9eb44514 | 55 | /************STUFF TO FIX****************************** |
ikenna1 | 25:faba9eb44514 | 56 | it seems that the weapons function and the enemy function thinks that the ship is locked to the top of the screen at 0,0. so while the ship can move |
ikenna1 | 25:faba9eb44514 | 57 | the seeker does not follow the ship and the weapon firing sprites are drawn wrongly |
ikenna1 | 25:faba9eb44514 | 58 | */ |
ikenna1 | 2:66a4e5d7a7cd | 59 | #endif |