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
SpaceInvaderEngine/SpaceInvaderEngine.h@11:c174d84e4866, 2020-04-01 (annotated)
- Committer:
- josh_ohara
- Date:
- Wed Apr 01 11:23:25 2020 +0000
- Revision:
- 11:c174d84e4866
- Parent:
- 10:9189419fda68
- Child:
- 12:be491ab6e742
Bullet vector completed
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
josh_ohara | 6:5bea67cc96f9 | 1 | #ifndef SPACEINVADERENGINE_H |
josh_ohara | 6:5bea67cc96f9 | 2 | #define SPACEINVADERENGINE_H |
josh_ohara | 6:5bea67cc96f9 | 3 | |
josh_ohara | 6:5bea67cc96f9 | 4 | #include "mbed.h" |
josh_ohara | 6:5bea67cc96f9 | 5 | #include "N5110.h" |
josh_ohara | 6:5bea67cc96f9 | 6 | #include "Gamepad.h" |
josh_ohara | 11:c174d84e4866 | 7 | #include "BulletS.h" |
josh_ohara | 6:5bea67cc96f9 | 8 | #include "Ship.h" |
josh_ohara | 9:8e695df3cc36 | 9 | #include "Alien.h" |
josh_ohara | 11:c174d84e4866 | 10 | #include <vector> |
josh_ohara | 6:5bea67cc96f9 | 11 | |
josh_ohara | 6:5bea67cc96f9 | 12 | #define BORDER 2 |
josh_ohara | 6:5bea67cc96f9 | 13 | |
josh_ohara | 6:5bea67cc96f9 | 14 | class SpaceInvaderEngine |
josh_ohara | 6:5bea67cc96f9 | 15 | { |
josh_ohara | 6:5bea67cc96f9 | 16 | |
josh_ohara | 6:5bea67cc96f9 | 17 | public: |
josh_ohara | 6:5bea67cc96f9 | 18 | SpaceInvaderEngine(); |
josh_ohara | 8:86cb9a9f8a73 | 19 | ~SpaceInvaderEngine(); |
josh_ohara | 9:8e695df3cc36 | 20 | void init(int ship_height, int ship_width, int alien_size); |
josh_ohara | 6:5bea67cc96f9 | 21 | void read_input(Gamepad &pad); |
josh_ohara | 10:9189419fda68 | 22 | void update(Gamepad &pad, N5110 &lcd); |
josh_ohara | 8:86cb9a9f8a73 | 23 | void render(N5110 &lcd); |
josh_ohara | 11:c174d84e4866 | 24 | void shoot_bullet(); |
josh_ohara | 11:c174d84e4866 | 25 | void SpaceInvaderEngine::get_ship_pos(); |
josh_ohara | 6:5bea67cc96f9 | 26 | |
josh_ohara | 6:5bea67cc96f9 | 27 | private: |
josh_ohara | 6:5bea67cc96f9 | 28 | |
josh_ohara | 9:8e695df3cc36 | 29 | Alien A1; |
josh_ohara | 6:5bea67cc96f9 | 30 | Ship S1; |
josh_ohara | 11:c174d84e4866 | 31 | BulletS BS1; |
josh_ohara | 6:5bea67cc96f9 | 32 | |
josh_ohara | 6:5bea67cc96f9 | 33 | int S1_height; |
josh_ohara | 6:5bea67cc96f9 | 34 | int S1_width; |
josh_ohara | 9:8e695df3cc36 | 35 | int A1_size; |
josh_ohara | 6:5bea67cc96f9 | 36 | |
josh_ohara | 9:8e695df3cc36 | 37 | int A1y; |
josh_ohara | 11:c174d84e4866 | 38 | int BS1x; |
josh_ohara | 11:c174d84e4866 | 39 | int BS1y; |
josh_ohara | 6:5bea67cc96f9 | 40 | |
josh_ohara | 6:5bea67cc96f9 | 41 | Direction D; |
josh_ohara | 6:5bea67cc96f9 | 42 | float Mag; |
josh_ohara | 11:c174d84e4866 | 43 | |
josh_ohara | 11:c174d84e4866 | 44 | vector<Bullet> BulletS; |
josh_ohara | 11:c174d84e4866 | 45 | |
josh_ohara | 6:5bea67cc96f9 | 46 | |
josh_ohara | 6:5bea67cc96f9 | 47 | }; |
josh_ohara | 6:5bea67cc96f9 | 48 | |
josh_ohara | 6:5bea67cc96f9 | 49 | #endif |