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@34:6d0786582d81, 2019-04-30 (annotated)
- Committer:
- ikenna1
- Date:
- Tue Apr 30 05:03:15 2019 +0000
- Revision:
- 34:6d0786582d81
- Parent:
- 33:7a814c874c57
- Child:
- 35:3341f2bd0408
Changed declaration of _shooter1_pos
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 | 27:f99249e727fd | 21 | void reset(); |
ikenna1 | 2:66a4e5d7a7cd | 22 | void read_input(Gamepad &pad); |
ikenna1 | 2:66a4e5d7a7cd | 23 | void update(Gamepad &pad); |
ikenna1 | 14:88ca5b1a111a | 24 | void draw(N5110 &lcd, Gamepad &pad); |
ikenna1 | 9:241a1a7d8527 | 25 | void get_pos(); |
ikenna1 | 10:c33d7593a275 | 26 | void title(N5110 &lcd); |
ikenna1 | 13:e114d362186d | 27 | int get_ycursor(); |
ikenna1 | 21:628fb703188f | 28 | int get_shipno(); |
ikenna1 | 12:47578eb9ea73 | 29 | void ship_select(N5110 &lcd); |
ikenna1 | 30:711d722f3cef | 30 | |
ikenna1 | 9:241a1a7d8527 | 31 | |
ikenna1 | 9:241a1a7d8527 | 32 | int ship_xpos; |
ikenna1 | 9:241a1a7d8527 | 33 | int ship_ypos; |
ikenna1 | 9:241a1a7d8527 | 34 | int ship_width; |
ikenna1 | 25:faba9eb44514 | 35 | int ship_height; |
ikenna1 | 25:faba9eb44514 | 36 | //*** note: add ship width and ship heirgth in place of 6 and 9 to generalize arrays after they are finished |
ikenna1 | 10:c33d7593a275 | 37 | |
ikenna1 | 2:66a4e5d7a7cd | 38 | private: |
ikenna1 | 32:098fbc1222cd | 39 | bool shooter_weapon_collision(int sh_no); |
ikenna1 | 33:7a814c874c57 | 40 | bool shooter_ship_collision(int sh_no); |
ikenna1 | 33:7a814c874c57 | 41 | bool seeker_ship_collision(); |
ikenna1 | 33:7a814c874c57 | 42 | bool enemy_projectile_collision(); |
ikenna1 | 33:7a814c874c57 | 43 | Vector2D shooter_projectile_collision(); |
ikenna1 | 30:711d722f3cef | 44 | void score(int points); |
ikenna1 | 4:740e14ebbc97 | 45 | |
ikenna1 | 4:740e14ebbc97 | 46 | // Variables |
ikenna1 | 8:87a845b8575e | 47 | Ship _ship; |
ikenna1 | 9:241a1a7d8527 | 48 | Weapons _weapons; |
ikenna1 | 9:241a1a7d8527 | 49 | Menu _menu; |
ikenna1 | 15:009ccc07bb57 | 50 | Enemy _enemy; |
ikenna1 | 17:e65a9f981834 | 51 | Health _health; |
ikenna1 | 4:740e14ebbc97 | 52 | float _xjoystick; |
ikenna1 | 4:740e14ebbc97 | 53 | float _yjoystick; |
ikenna1 | 9:241a1a7d8527 | 54 | Direction _d; |
ikenna1 | 10:c33d7593a275 | 55 | int _ycursor; |
ikenna1 | 21:628fb703188f | 56 | int _shipno; |
ikenna1 | 30:711d722f3cef | 57 | int _score; |
ikenna1 | 34:6d0786582d81 | 58 | int _shno; |
ikenna1 | 34:6d0786582d81 | 59 | Vector2D _shooter1_pos; |
ikenna1 | 34:6d0786582d81 | 60 | Vector2D _shooter2_pos; |
ikenna1 | 34:6d0786582d81 | 61 | Vector2D _shooter3_pos; |
ikenna1 | 34:6d0786582d81 | 62 | Vector2D _coloc; |
ikenna1 | 25:faba9eb44514 | 63 | |
ikenna1 | 2:66a4e5d7a7cd | 64 | |
ikenna1 | 2:66a4e5d7a7cd | 65 | }; |
ikenna1 | 25:faba9eb44514 | 66 | /************STUFF TO FIX****************************** |
ikenna1 | 28:6319e928f0aa | 67 | **** add sound effects for sjield braking |
ikenna1 | 28:6319e928f0aa | 68 | **** add passive shield regeneration |
ikenna1 | 29:4c7b16b5b6df | 69 | **** work on score increase |
ikenna1 | 29:4c7b16b5b6df | 70 | **** add title screen with name |
ikenna1 | 29:4c7b16b5b6df | 71 | **** make it so back asks you if you are sure and ststes that you will lose all progress |
ikenna1 | 29:4c7b16b5b6df | 72 | **** think of level system |
ikenna1 | 29:4c7b16b5b6df | 73 | **** orion should send out pulses that stun enemy ships and absorb thier shields(use draw line) |
ikenna1 | 29:4c7b16b5b6df | 74 | **** scale shields properly |
ikenna1 | 29:4c7b16b5b6df | 75 | **** fix the border issue(i.e the ships clip through healthbar) |
ikenna1 | 30:711d722f3cef | 76 | **** make it so enemy ship spawning is random use srand |
ikenna1 | 34:6d0786582d81 | 77 | **** add in options for lcd brightness and contrast |
ikenna1 | 34:6d0786582d81 | 78 | **** add in cheats |
ikenna1 | 34:6d0786582d81 | 79 | **** |
ikenna1 | 25:faba9eb44514 | 80 | */ |
ikenna1 | 2:66a4e5d7a7cd | 81 | #endif |