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@7:06a2558155f0, 2020-03-24 (annotated)
- Committer:
- josh_ohara
- Date:
- Tue Mar 24 16:44:48 2020 +0000
- Revision:
- 7:06a2558155f0
- Parent:
- 6:5bea67cc96f9
- Child:
- 8:86cb9a9f8a73
Need to stop trying to write whole game at once. Going to get each object working first, starting with the ship.
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 | 6:5bea67cc96f9 | 7 | #include "BulletS.h" |
josh_ohara | 6:5bea67cc96f9 | 8 | #include "Ship.h" |
josh_ohara | 6:5bea67cc96f9 | 9 | #include "Alien.h" |
josh_ohara | 6:5bea67cc96f9 | 10 | |
josh_ohara | 6:5bea67cc96f9 | 11 | #define BORDER 2 |
josh_ohara | 6:5bea67cc96f9 | 12 | |
josh_ohara | 6:5bea67cc96f9 | 13 | class SpaceInvaderEngine |
josh_ohara | 6:5bea67cc96f9 | 14 | { |
josh_ohara | 6:5bea67cc96f9 | 15 | |
josh_ohara | 6:5bea67cc96f9 | 16 | public: |
josh_ohara | 6:5bea67cc96f9 | 17 | SpaceInvaderEngine(); |
josh_ohara | 7:06a2558155f0 | 18 | void init(int ship_height, int ship_width, int ship_bullet_size, int alien_size); |
josh_ohara | 6:5bea67cc96f9 | 19 | void read_input(Gamepad &pad); |
josh_ohara | 6:5bea67cc96f9 | 20 | void update(Gamepad &pad); |
josh_ohara | 6:5bea67cc96f9 | 21 | void draw(N5110 &lcd); |
josh_ohara | 6:5bea67cc96f9 | 22 | |
josh_ohara | 6:5bea67cc96f9 | 23 | private: |
josh_ohara | 6:5bea67cc96f9 | 24 | |
josh_ohara | 6:5bea67cc96f9 | 25 | void read_input(Gamepad &pad); |
josh_ohara | 6:5bea67cc96f9 | 26 | void draw(N5110 &lcd); |
josh_ohara | 7:06a2558155f0 | 27 | void check_alien_collision(Gamepad &pad); |
josh_ohara | 6:5bea67cc96f9 | 28 | |
josh_ohara | 6:5bea67cc96f9 | 29 | Alien A1; |
josh_ohara | 6:5bea67cc96f9 | 30 | Ship S1; |
josh_ohara | 6:5bea67cc96f9 | 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 | 6:5bea67cc96f9 | 35 | int A1_size; |
josh_ohara | 7:06a2558155f0 | 36 | int BS1_size; |
josh_ohara | 6:5bea67cc96f9 | 37 | |
josh_ohara | 7:06a2558155f0 | 38 | int A1y; |
josh_ohara | 7:06a2558155f0 | 39 | int BS1x; |
josh_ohara | 6:5bea67cc96f9 | 40 | |
josh_ohara | 6:5bea67cc96f9 | 41 | Direction D; |
josh_ohara | 6:5bea67cc96f9 | 42 | float Mag; |
josh_ohara | 6:5bea67cc96f9 | 43 | |
josh_ohara | 6:5bea67cc96f9 | 44 | }; |
josh_ohara | 6:5bea67cc96f9 | 45 | |
josh_ohara | 6:5bea67cc96f9 | 46 | #endif |