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
- Committer:
- ellisbhastroud
- Date:
- 2019-04-17
- Revision:
- 7:5a19dd9fe8a4
- Parent:
- 6:747335f697d6
- Child:
- 8:d410856c6d04
File content as of revision 7:5a19dd9fe8a4:
#include "GolfEngine.h" // constructor GolfEngine::GolfEngine() { } //deconstructor GolfEngine::~GolfEngine() { } void GolfEngine::init() { } void GolfEngine::drawGame(N5110 &lcd) { _ball.drawBall(lcd); _ball.printShotCount(lcd); drawCourseWalls(lcd); } void GolfEngine::update_ball(Gamepad &pad, int frame_rate) { _ball.shoot_ball(pad); _ball.check_wall_bounce(); _ball.move_ball(frame_rate); _ball.check_wall_bounce(); } void GolfEngine::drawCourseWalls(N5110 &lcd) { for(int i = 0; i > 5; i++) { 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 } }