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.
Ball/Ball.h@17:5104ecef5bd0, 2019-04-15 (annotated)
- Committer:
- JamesCummins
- Date:
- Mon Apr 15 13:28:30 2019 +0000
- Revision:
- 17:5104ecef5bd0
- Parent:
- 13:e5a36fbd48ae
- Child:
- 23:61fa82f76808
Brickbreaker not working, all else working fine
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| JamesCummins | 9:ce0a12fb205b | 1 | #ifndef BALL_H |
| JamesCummins | 9:ce0a12fb205b | 2 | #define BALL_H |
| JamesCummins | 9:ce0a12fb205b | 3 | |
| JamesCummins | 9:ce0a12fb205b | 4 | #include "mbed.h" |
| JamesCummins | 9:ce0a12fb205b | 5 | #include "N5110.h" |
| JamesCummins | 9:ce0a12fb205b | 6 | #include "Gamepad.h" |
| JamesCummins | 9:ce0a12fb205b | 7 | #include "FXOS8700CQ.h" |
| JamesCummins | 9:ce0a12fb205b | 8 | |
| JamesCummins | 9:ce0a12fb205b | 9 | |
| JamesCummins | 9:ce0a12fb205b | 10 | class Ball { |
| JamesCummins | 9:ce0a12fb205b | 11 | |
| JamesCummins | 9:ce0a12fb205b | 12 | public: |
| JamesCummins | 9:ce0a12fb205b | 13 | //constructor method |
| JamesCummins | 9:ce0a12fb205b | 14 | Ball(); |
| JamesCummins | 9:ce0a12fb205b | 15 | //destructor method |
| JamesCummins | 9:ce0a12fb205b | 16 | ~Ball(); |
| JamesCummins | 9:ce0a12fb205b | 17 | //methods for engine |
| JamesCummins | 9:ce0a12fb205b | 18 | void init(int radius); |
| JamesCummins | 17:5104ecef5bd0 | 19 | void read_input(FXOS8700CQ &accelerometer); |
| JamesCummins | 17:5104ecef5bd0 | 20 | void update(); |
| JamesCummins | 9:ce0a12fb205b | 21 | void draw(N5110 &lcd); |
| JamesCummins | 9:ce0a12fb205b | 22 | //accessor methods |
| JamesCummins | 9:ce0a12fb205b | 23 | Vector2D get_velocity(); |
| JamesCummins | 9:ce0a12fb205b | 24 | Vector2D get_position(); |
| JamesCummins | 10:40c77d69e83c | 25 | int get_radius(); |
| JamesCummins | 9:ce0a12fb205b | 26 | //mutator methods |
| JamesCummins | 9:ce0a12fb205b | 27 | void set_velocity(Vector2D vel); |
| JamesCummins | 9:ce0a12fb205b | 28 | void set_position(Vector2D pos); |
| JamesCummins | 10:40c77d69e83c | 29 | void set_radius(int radius); |
| JamesCummins | 9:ce0a12fb205b | 30 | |
| JamesCummins | 9:ce0a12fb205b | 31 | private: |
| JamesCummins | 11:2cf0d4ce8677 | 32 | int _radius; |
| JamesCummins | 11:2cf0d4ce8677 | 33 | int _x; |
| JamesCummins | 11:2cf0d4ce8677 | 34 | int _y; |
| JamesCummins | 9:ce0a12fb205b | 35 | Vector2D _velocity; |
| JamesCummins | 9:ce0a12fb205b | 36 | }; |
| JamesCummins | 9:ce0a12fb205b | 37 | #endif |