ELEC2645 (2018/19) / Mbed 2 deprecated el17m2h_public

Dependencies:   mbed

Revision:
30:863565e9859f
Parent:
29:15e9640646b7
Child:
31:5c4acae51026
--- a/Enemy/Enemy.cpp	Wed May 08 21:11:35 2019 +0000
+++ b/Enemy/Enemy.cpp	Thu May 09 08:59:39 2019 +0000
@@ -8,23 +8,19 @@
 void Enemy::update(Vector2D floor_pos)  // sets its position
 {
     _position.x = floor_pos.x + 7 - 6; // the + 7 for the centre of the floor and the + 6 for the centre of the ghost
-    _position.y = floor_pos.y - 2 - 15; // the - 2 is so that it is on top of the floor's position 
+    _position.y = floor_pos.y - 2 - 13; // the - 2 is so that it is on top of the floor's position 
     // and the + 15 is so that it considers the position of the feet of the ghost (not the top)
 }
 
 void Enemy::draw(N5110 &lcd)
 {
-    const int image [16][12] = {
+    const int image [12][12] = {
         {0,0,0,0,1,1,1,1,0,0,0,0},
         {0,0,1,1,0,0,0,0,1,1,0,0},
         {0,1,0,0,0,0,0,0,0,0,1,0},
-        {1,1,0,0,0,0,0,0,0,0,1,1},
-        {1,0,1,0,0,0,0,0,0,1,0,1},
-        {1,0,1,1,1,0,0,1,1,1,0,1},
+        {1,0,0,1,0,0,0,0,1,0,0,1},
         {1,0,1,1,1,0,0,1,1,1,0,1},
-        {1,0,0,0,0,0,0,0,0,0,0,1},
-        {1,0,0,0,0,0,0,0,0,0,0,1},
-        {1,0,0,0,0,0,0,0,0,0,0,1},
+        {1,0,0,1,0,0,0,0,1,0,0,1},
         {1,0,0,0,0,0,0,0,0,0,0,1},
         {1,0,0,0,0,0,0,0,0,0,0,1},
         {1,0,0,0,0,0,0,0,0,0,0,1},
@@ -32,7 +28,7 @@
         {1,1,0,1,1,0,0,1,1,0,1,1},
         {1,0,0,0,1,0,0,1,0,0,0,1},
     };
-    lcd.drawSprite(_position.x, _position.y, 16, 12,(int*)image);
+    lcd.drawSprite(_position.x, _position.y, 12, 12,(int*)image);
 }
 
 void Enemy::erase()  // decides if it gets erased