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
SpaceInvadersEngine/SpaceInvadersEngine.h@5:476696df08dd, 2019-04-14 (annotated)
- Committer:
- fy14lkaa
- Date:
- Sun Apr 14 14:29:05 2019 +0000
- Revision:
- 5:476696df08dd
- Child:
- 6:38d76d2da485
re-create the Space Invaders Engine folder after deleted by mistake. inulde all the classes
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| fy14lkaa | 5:476696df08dd | 1 | |
| fy14lkaa | 5:476696df08dd | 2 | #include "mbed.h" |
| fy14lkaa | 5:476696df08dd | 3 | #include "N5110.h" |
| fy14lkaa | 5:476696df08dd | 4 | #include "Gamepad.h" |
| fy14lkaa | 5:476696df08dd | 5 | |
| fy14lkaa | 5:476696df08dd | 6 | |
| fy14lkaa | 5:476696df08dd | 7 | |
| fy14lkaa | 5:476696df08dd | 8 | // gap from edge of screen |
| fy14lkaa | 5:476696df08dd | 9 | #define GAP 2 |
| fy14lkaa | 5:476696df08dd | 10 | |
| fy14lkaa | 5:476696df08dd | 11 | |
| fy14lkaa | 5:476696df08dd | 12 | class PongEngine |
| fy14lkaa | 5:476696df08dd | 13 | { |
| fy14lkaa | 5:476696df08dd | 14 | |
| fy14lkaa | 5:476696df08dd | 15 | public: |
| fy14lkaa | 5:476696df08dd | 16 | SpaceInvadersEngine(); |
| fy14lkaa | 5:476696df08dd | 17 | ~SpaceInvadersEngine(); |
| fy14lkaa | 5:476696df08dd | 18 | |
| fy14lkaa | 5:476696df08dd | 19 | void init(int space_ship_width,int space_ship_height,int bullet_size, int alien_size, int speed); |
| fy14lkaa | 5:476696df08dd | 20 | void read_input(Gamepad &pad); |
| fy14lkaa | 5:476696df08dd | 21 | void update(Gamepad &pad); |
| fy14lkaa | 5:476696df08dd | 22 | void draw(N5110 &lcd); |
| fy14lkaa | 5:476696df08dd | 23 | |
| fy14lkaa | 5:476696df08dd | 24 | |
| fy14lkaa | 5:476696df08dd | 25 | |
| fy14lkaa | 5:476696df08dd | 26 | private: |
| fy14lkaa | 5:476696df08dd | 27 | |
| fy14lkaa | 5:476696df08dd | 28 | void check_wall_collision(Gamepad &pad); |
| fy14lkaa | 5:476696df08dd | 29 | void space_ship_collisions(Gamepad &pad); |
| fy14lkaa | 5:476696df08dd | 30 | void check_goal(Gamepad &pad); |
| fy14lkaa | 5:476696df08dd | 31 | void print_scores(N5110 &lcd); |
| fy14lkaa | 5:476696df08dd | 32 | |
| fy14lkaa | 5:476696df08dd | 33 | //Paddle _p1; |
| fy14lkaa | 5:476696df08dd | 34 | //Paddle _p2; |
| fy14lkaa | 5:476696df08dd | 35 | |
| fy14lkaa | 5:476696df08dd | 36 | int _ space_ship_width; |
| fy14lkaa | 5:476696df08dd | 37 | int _ space_ship_height; |
| fy14lkaa | 5:476696df08dd | 38 | int _bullet_size; |
| fy14lkaa | 5:476696df08dd | 39 | int _alien_size; |
| fy14lkaa | 5:476696df08dd | 40 | int _speed; |
| fy14lkaa | 5:476696df08dd | 41 | |
| fy14lkaa | 5:476696df08dd | 42 | |
| fy14lkaa | 5:476696df08dd | 43 | |
| fy14lkaa | 5:476696df08dd | 44 | /* // x positions of the paddles |
| fy14lkaa | 5:476696df08dd | 45 | int _p1x; |
| fy14lkaa | 5:476696df08dd | 46 | int _p2x; |
| fy14lkaa | 5:476696df08dd | 47 | |
| fy14lkaa | 5:476696df08dd | 48 | Ball _ball; |
| fy14lkaa | 5:476696df08dd | 49 | |
| fy14lkaa | 5:476696df08dd | 50 | Direction _d; |
| fy14lkaa | 5:476696df08dd | 51 | float _mag; |
| fy14lkaa | 5:476696df08dd | 52 | */ |
| fy14lkaa | 5:476696df08dd | 53 | |
| fy14lkaa | 5:476696df08dd | 54 | }; |
| fy14lkaa | 5:476696df08dd | 55 | |
| fy14lkaa | 5:476696df08dd | 56 | #endif |
| fy14lkaa | 5:476696df08dd | 57 |