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:
- 47:29c4796a49e5
- Parent:
- 46:e39abe665271
- Child:
- 48:8ccfc74b60a5
diff -r e39abe665271 -r 29c4796a49e5 GraphicEngine/GraphicEngine.cpp
--- a/GraphicEngine/GraphicEngine.cpp Sat May 23 02:55:16 2020 +0000
+++ b/GraphicEngine/GraphicEngine.cpp Sat May 23 03:53:33 2020 +0000
@@ -82,9 +82,23 @@
}
/* TO-DO: ADD SPRITES AND SPRITE STATE */
-void GraphicEngine::showFrog(float x, int y, int width, int height)
+void GraphicEngine::showFrog(float x, int y, int width, int height, int state)
{
- lcd.drawRect(x, y, width, height, FILL_BLACK);
+ switch(state)
+ {
+ case 0:
+ lcd.drawSprite(x, y, 4, 6, (int *)frog_state_up);
+ break;
+ case 1:
+ lcd.drawSprite(x, y, 4, 6, (int *)frog_state_left);
+ break;
+ case 2:
+ lcd.drawSprite(x, y, 4, 6, (int *)frog_state_right);
+ break;
+ case 3:
+ lcd.drawSprite(x, y, 4, 6, (int *)frog_state_down);
+ break;
+ }
}
void GraphicEngine::drawGoal(int x, int row)