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.
Classic_Engine/ClassicEngine.cpp@29:42651f87522b, 2019-04-27 (annotated)
- Committer:
- JamesCummins
- Date:
- Sat Apr 27 12:50:30 2019 +0000
- Revision:
- 29:42651f87522b
- Parent:
- 20:4a39a1a2be51
- Child:
- 31:c95f1b1d6423
Classic wall collision coded but always returning true (preventing classic from running) - needs debugging
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JamesCummins | 29:42651f87522b | 1 | #include "ClassicEngine.h" |
JamesCummins | 29:42651f87522b | 2 | |
JamesCummins | 29:42651f87522b | 3 | ClassicEngine::ClassicEngine(){ |
JamesCummins | 29:42651f87522b | 4 | } |
JamesCummins | 29:42651f87522b | 5 | |
JamesCummins | 29:42651f87522b | 6 | ClassicEngine::~ClassicEngine(){ |
JamesCummins | 20:4a39a1a2be51 | 7 | } |
JamesCummins | 20:4a39a1a2be51 | 8 | |
JamesCummins | 29:42651f87522b | 9 | void ClassicEngine::init(Ball &ball, Map &map){ |
JamesCummins | 29:42651f87522b | 10 | _ball_coord.x = 42; |
JamesCummins | 29:42651f87522b | 11 | _ball_coord.y = 24; |
JamesCummins | 29:42651f87522b | 12 | _map_coord.x = 47; |
JamesCummins | 29:42651f87522b | 13 | _map_coord.y = 25; |
JamesCummins | 29:42651f87522b | 14 | ball.set_position(_ball_coord); |
JamesCummins | 29:42651f87522b | 15 | map.set_map_display(_map_coord); |
JamesCummins | 20:4a39a1a2be51 | 16 | } |
JamesCummins | 29:42651f87522b | 17 | |
JamesCummins | 29:42651f87522b | 18 | void ClassicEngine::classic_update(Ball &ball, FXOS8700CQ &accelerometer, Map &map){ |
JamesCummins | 29:42651f87522b | 19 | map.read_input(accelerometer, ball); |
JamesCummins | 29:42651f87522b | 20 | map.update(); |
JamesCummins | 29:42651f87522b | 21 | ball.set_position(_ball_coord); |
JamesCummins | 29:42651f87522b | 22 | } |
JamesCummins | 29:42651f87522b | 23 | |
JamesCummins | 29:42651f87522b | 24 | void ClassicEngine::classic_draw(N5110 &lcd, Map &map, Ball &ball){ |
JamesCummins | 29:42651f87522b | 25 | map.draw(lcd); |
JamesCummins | 29:42651f87522b | 26 | ball.draw(lcd); |
JamesCummins | 29:42651f87522b | 27 | } |