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:
- 13:cd6d2f999057
- Parent:
- 8:52794de935b2
- Child:
- 14:6fe667ec957e
diff -r a0e0939a498f -r cd6d2f999057 GraphicEngine/GraphicEngine.cpp --- a/GraphicEngine/GraphicEngine.cpp Wed May 13 03:04:45 2020 +0000 +++ b/GraphicEngine/GraphicEngine.cpp Wed May 13 03:59:27 2020 +0000 @@ -60,6 +60,29 @@ displayCar(temp_car); } + +void CrossyChicken::drawSprites(char obj, int x, int y, int rows, int cols) +{ + switch(obj) + { + case 'L': + lcd.drawSprite(x, y, rows, cols, (int *)left_racer); + + case 'R' : + lcd.drawSprite(x, y, rows, cols, (int *)right_racer); + + case 'B': + lcd.drawSprite(x, y, rows, cols, (int *)bus); + + case 'N': + lcd.drawSprite(x, y, rows, cols, (int *)right_normal); + + case 'X': + lcd.drawSprite(x, y, rows, cols, (int *)left_normal); + } +} + + void GraphicEngine::displayCar(DrawCar &size){ lcd.drawRect(size.x, size.y, size.width, size.height, FILL_TRANSPARENT); }