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:
- 4:aae7f8d4ab78
- Parent:
- 3:648c9d5001be
- Child:
- 5:6e3afee7eac3
--- a/GraphicEngine/GraphicEngine.cpp Mon May 04 03:55:03 2020 +0000 +++ b/GraphicEngine/GraphicEngine.cpp Wed May 06 16:53:18 2020 +0000 @@ -11,27 +11,34 @@ void GraphicEngine::showChicken(){ //fill the chicken with black color - lcd.drawRect(chick->leftSide, chick->topSide, chick->rightSide, chick->bottomSide, FILL_BLACK); + lcd.drawRect(chick->x, chick->y, chick->width, chick->width, FILL_BLACK); } -void GraphicEngine::showCar(Car cars[]){ - //first car - lcd.drawRect(cars[0].left, 48 - 8*2, 8*2, 8, FILL_BLACK); - - //second car - lcd.drawRect(cars[1].left + 40, 48 - 8*2, 8*2, 8, FILL_BLACK); - - //first car - lcd.drawRect(cars[2].left, 48 - 8*2, 8*3, 8, FILL_BLACK); - - //second car - lcd.drawRect(cars[3].left + 20, 48 - 8*3, 8, 8, FILL_BLACK); - - if(cars[0].left > 70 && cars[1].left > 100){ - cars[0].left = -cars[0].right; - cars[1].left = -cars[1].right; - //wait_ms(100); - } +// TO DO: +// -> make multiple lanes of cars (first manually then automatically) +// -> make one lane go other direction +// -> make a safety lane +// -> make a logs +// -> make turtles +// -> make the ocean (if collision with ocean then dead) +// -> make multiple lives +// -> point system +// -> make the sprite images +// -> make background object (sprite of entire screen) +// -> make menu screen +// -> collision +// -> make sprite of safety lanes +// -> make snake object +// BONUS: +// --> make multiple levels +// --> time constraint + +void GraphicEngine::showCar(Car *car){ + // safety lane + lcd.drawRect(0, 48 - 4, 84, 4, FILL_TRANSPARENT); + lcd.drawRect(0, 48 - 4*6, 84, 4, FILL_TRANSPARENT); + + lcd.drawRect(car->left_car.x, car->left_car.y, car->left_car.height, car->left_car.width, FILL_BLACK); } void GraphicEngine::contrast(){