ELEC2645 (2018/19) / Mbed 2 deprecated fy14lkaa

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
fy14lkaa
Date:
Sun May 05 01:47:15 2019 +0000
Parent:
96:01434284987f
Child:
98:663e584183bf
Commit message:
added void draw function to draw the alien by using lcd.drawRect.

Changed in this revision

Alien/Alien.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Alien/Alien.cpp	Sun May 05 01:41:53 2019 +0000
+++ b/Alien/Alien.cpp	Sun May 05 01:47:15 2019 +0000
@@ -14,9 +14,14 @@
 
 void Alien::init(int x_alien,int y_alien, int speed_alien)
 {
-   
+
     _x_alien = x_alien;
     _y_alien = y_alien;
-   _speed_alien = speed_alien;
+    _speed_alien = speed_alien;
 
 }
+
+void Alien::draw(N5110 &lcd)
+{
+    lcd.drawRect(_x_alien,_y_alien,_x_alien+5,_y_alien+5,FILL_BLACK);
+}