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
Diff: GraphicEngine/GraphicEngine.cpp
- Revision:
- 43:2cd1cfe07770
- Parent:
- 42:04e326dcf09b
- Child:
- 44:f02510eeb165
--- a/GraphicEngine/GraphicEngine.cpp Mon May 18 04:39:06 2020 +0000 +++ b/GraphicEngine/GraphicEngine.cpp Mon May 18 06:34:53 2020 +0000 @@ -1,6 +1,9 @@ #include "GraphicEngine.h" -GraphicEngine::GraphicEngine(){} +GraphicEngine::GraphicEngine(Frog *frogptr){ + this->frog = frogptr; + +} void GraphicEngine::init() { @@ -30,7 +33,7 @@ void GraphicEngine::showObj(Object &obj) { - if(obj.object.c = 'G' || obj.object.c = 'M' || obj.object.c = 'T') { + if(obj.object.c == 'G' || obj.object.c == 'M' || obj.object.c == 'T') { displayLog(obj.object.x, obj.object.y, obj.object.c); } else { displayVehicle(obj.object.x, obj.object.y, obj.object.c); @@ -59,28 +62,28 @@ switch(c) { case 'G': - lcd.drawSprite(x, y, 4, 4, (int *)big_log); + lcd.drawSprite(x, y, 4, 12, (int *)log_big); break; case 'M': - lcd.drawSprite(x, y, 4, 4, (int *)medium_log); + lcd.drawSprite(x, y, 4, 8, (int *)medium_log); break; case 'T': - lcd.drawSprite(x, y, 4, 4, (int *)turtles); + lcd.drawSprite(x, y, 4, 12, (int *)turtles); break; } } /* TO-DO: ADD SPRITES AND SPRITE STATE */ -void GraphicEngine::showFrog(Frog &frog) +void GraphicEngine::showFrog(float x, int y, int width, int height) { - lcd.drawRect(frog.x, frog.y, frog.width, frog.height, FILL_BLACK); + lcd.drawRect(x, y, width, height, FILL_BLACK); } void GraphicEngine::drawGoal(int x, int row) { - lcd.drawSprite(x, row, 8, 8, (int *)end_post); + //lcd.drawSprite(x, row, 8, 8, (int *)end_post); } void GraphicEngine::drawSafetyLanes() @@ -96,3 +99,4 @@ void GraphicEngine::print(){ lcd.printString("DROWNED",1,1); } +