ELEC2645 (2018/19) / Mbed 2 deprecated el17ttds

Dependencies:   mbed N5110_tf

Revision:
9:3a0194c87afe
Parent:
8:d1c04f0e4890
--- a/Hero/Hero.cpp	Sat May 11 08:23:54 2019 +0000
+++ b/Hero/Hero.cpp	Sun May 12 16:21:08 2019 +0000
@@ -5,8 +5,8 @@
 }
 
 void Hero::init(int swidth, int sheight) {
-  _x = swidth / 2;
-  _y = sheight / 2;
+  _x = swidth / 2 - 5;
+  _y = sheight / 2 - 5;
   // frame_counter = 0;
   _health = 3;
   // _health_rate = 50; possible addition
@@ -22,7 +22,21 @@
 }
 
 void Hero::draw(N5110 &lcd) {
-  lcd.drawCircle( _x, _y, 5, FILL_TRANSPARENT);
+  //lcd.drawCircle( _x, _y, 5, FILL_TRANSPARENT);
+  int const hero[11][11] = {
+    {0,0,1,1,1,1,1,1,1,0,0},
+    {0,1,1,0,0,0,0,0,1,1,0},
+    {1,1,0,0,0,0,0,0,0,1,1},
+    {1,0,0,1,1,0,1,1,0,0,1},
+    {1,0,0,1,1,0,1,1,0,0,1},
+    {1,0,0,0,0,0,0,0,0,0,1},
+    {1,0,0,1,1,1,1,1,0,0,1},
+    {1,0,0,1,1,1,1,1,0,0,1},
+    {1,1,0,1,1,1,1,1,0,1,1},
+    {0,1,1,0,0,0,0,0,1,1,0},
+    {0,0,1,1,1,1,1,1,1,0,0},
+  };
+  lcd.drawSprite( _x, _y, 11, 11, (int *)hero);
 }
 
 int Hero::get_health() {