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 FATFileSystem
GolfEngine/GolfEngine.cpp@6:747335f697d6, 2019-04-17 (annotated)
- Committer:
- ellisbhastroud
- Date:
- Wed Apr 17 10:35:52 2019 +0000
- Revision:
- 6:747335f697d6
- Parent:
- 5:0b31909caf7f
- Child:
- 7:5a19dd9fe8a4
Wont Compile - Finding Error
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ellisbhastroud | 5:0b31909caf7f | 1 | #include "GolfEngine.h" |
ellisbhastroud | 5:0b31909caf7f | 2 | |
ellisbhastroud | 5:0b31909caf7f | 3 | void GolfEngine::init() |
ellisbhastroud | 5:0b31909caf7f | 4 | { |
ellisbhastroud | 6:747335f697d6 | 5 | |
ellisbhastroud | 5:0b31909caf7f | 6 | } |
ellisbhastroud | 5:0b31909caf7f | 7 | |
ellisbhastroud | 5:0b31909caf7f | 8 | void GolfEngine::drawGame(N5110 &lcd) |
ellisbhastroud | 5:0b31909caf7f | 9 | { |
ellisbhastroud | 5:0b31909caf7f | 10 | _ball.drawBall(lcd); |
ellisbhastroud | 5:0b31909caf7f | 11 | _ball.printShotCount(lcd); |
ellisbhastroud | 5:0b31909caf7f | 12 | drawCourseWalls(lcd); |
ellisbhastroud | 5:0b31909caf7f | 13 | } |
ellisbhastroud | 5:0b31909caf7f | 14 | |
ellisbhastroud | 5:0b31909caf7f | 15 | void GolfEngine::update_ball(Gamepad &pad, int frame_rate) |
ellisbhastroud | 5:0b31909caf7f | 16 | { |
ellisbhastroud | 5:0b31909caf7f | 17 | |
ellisbhastroud | 5:0b31909caf7f | 18 | _ball.shoot_ball(pad); |
ellisbhastroud | 5:0b31909caf7f | 19 | _ball.check_wall_bounce(); |
ellisbhastroud | 5:0b31909caf7f | 20 | _ball.move_ball(frame_rate); |
ellisbhastroud | 5:0b31909caf7f | 21 | _ball.check_wall_bounce(); |
ellisbhastroud | 5:0b31909caf7f | 22 | } |
ellisbhastroud | 5:0b31909caf7f | 23 | |
ellisbhastroud | 5:0b31909caf7f | 24 | void GolfEngine::drawCourseWalls(N5110 &lcd) |
ellisbhastroud | 5:0b31909caf7f | 25 | { |
ellisbhastroud | 5:0b31909caf7f | 26 | for(int i = 0; i > 5; i++) { |
ellisbhastroud | 5:0b31909caf7f | 27 | lcd.drawLine(_level_1[i].start.x,_level_1[i].start.y,_level_1[i].end.x,_level_1[i].end.y,1); //draws line for each wall in course |
ellisbhastroud | 5:0b31909caf7f | 28 | } |
ellisbhastroud | 5:0b31909caf7f | 29 | } |
ellisbhastroud | 5:0b31909caf7f | 30 |