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@2:66a4e5d7a7cd, 2019-02-27 (annotated)
- Committer:
- ikenna1
- Date:
- Wed Feb 27 12:07:03 2019 +0000
- Revision:
- 2:66a4e5d7a7cd
- Child:
- 3:f9cd1a38d5c6
started working on bringing the lose code i have from other files into the project. 1st one being sprite_motion
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 | 2:66a4e5d7a7cd | 7 | |
ikenna1 | 2:66a4e5d7a7cd | 8 | |
ikenna1 | 2:66a4e5d7a7cd | 9 | class RosenEngine |
ikenna1 | 2:66a4e5d7a7cd | 10 | { |
ikenna1 | 2:66a4e5d7a7cd | 11 | |
ikenna1 | 2:66a4e5d7a7cd | 12 | public: |
ikenna1 | 2:66a4e5d7a7cd | 13 | RosenEngine(); |
ikenna1 | 2:66a4e5d7a7cd | 14 | ~RosenEngine(); |
ikenna1 | 2:66a4e5d7a7cd | 15 | |
ikenna1 | 2:66a4e5d7a7cd | 16 | void init(int paddle_width,int paddle_height,int ball_size,int speed); |
ikenna1 | 2:66a4e5d7a7cd | 17 | void read_input(Gamepad &pad); |
ikenna1 | 2:66a4e5d7a7cd | 18 | void update(Gamepad &pad); |
ikenna1 | 2:66a4e5d7a7cd | 19 | void draw(N5110 &lcd); |
ikenna1 | 2:66a4e5d7a7cd | 20 | |
ikenna1 | 2:66a4e5d7a7cd | 21 | private: |
ikenna1 | 2:66a4e5d7a7cd | 22 | |
ikenna1 | 2:66a4e5d7a7cd | 23 | void check_wall_collision(Gamepad &pad); |
ikenna1 | 2:66a4e5d7a7cd | 24 | void check_paddle_collisions(Gamepad &pad); |
ikenna1 | 2:66a4e5d7a7cd | 25 | void check_goal(Gamepad &pad); |
ikenna1 | 2:66a4e5d7a7cd | 26 | void print_scores(N5110 &lcd); |
ikenna1 | 2:66a4e5d7a7cd | 27 | |
ikenna1 | 2:66a4e5d7a7cd | 28 | Paddle _p1; |
ikenna1 | 2:66a4e5d7a7cd | 29 | Paddle _p2; |
ikenna1 | 2:66a4e5d7a7cd | 30 | |
ikenna1 | 2:66a4e5d7a7cd | 31 | int _paddle_width; |
ikenna1 | 2:66a4e5d7a7cd | 32 | int _paddle_height; |
ikenna1 | 2:66a4e5d7a7cd | 33 | int _ball_size; |
ikenna1 | 2:66a4e5d7a7cd | 34 | int _speed; |
ikenna1 | 2:66a4e5d7a7cd | 35 | |
ikenna1 | 2:66a4e5d7a7cd | 36 | // x positions of the paddles |
ikenna1 | 2:66a4e5d7a7cd | 37 | int _p1x; |
ikenna1 | 2:66a4e5d7a7cd | 38 | int _p2x; |
ikenna1 | 2:66a4e5d7a7cd | 39 | |
ikenna1 | 2:66a4e5d7a7cd | 40 | Ball _ball; |
ikenna1 | 2:66a4e5d7a7cd | 41 | |
ikenna1 | 2:66a4e5d7a7cd | 42 | Direction _d; |
ikenna1 | 2:66a4e5d7a7cd | 43 | float _mag; |
ikenna1 | 2:66a4e5d7a7cd | 44 | |
ikenna1 | 2:66a4e5d7a7cd | 45 | }; |
ikenna1 | 2:66a4e5d7a7cd | 46 | |
ikenna1 | 2:66a4e5d7a7cd | 47 | #endif |