ELEC2645 (2015/16) / el14hzbm_Final_Project

Fork of N5110 by Craig Evans

Files at this revision

API Documentation at this revision

Comitter:
Zafranhernandez
Date:
Thu May 05 11:33:36 2016 +0000
Parent:
20:9a847cf7585d
Commit message:
Updated version. Improved efficiency with added sleep and code comment.

Changed in this revision

N5110.cpp Show annotated file Show diff for this revision Revisions of this file
N5110.h Show annotated file Show diff for this revision Revisions of this file
--- a/N5110.cpp	Tue May 03 10:37:11 2016 +0000
+++ b/N5110.cpp	Thu May 05 11:33:36 2016 +0000
@@ -413,6 +413,34 @@
     drawRect(x0+4,y0+6,1,1,fill);
 }
 
+void N5110::drawCarReverse(int x0,int y0,int fill)
+{
+    drawRect(x0,y0,1,1,fill);
+    drawRect(x0+4,y0,1,1,fill);
+    drawRect(x0+2,y0+2,1,5,fill);
+    drawRect(x0,y0+4,5,1,fill);
+}
+
+void N5110::drawTruck(int x0,int y0,int fill)
+{
+    drawRect(x0+1,y0,3,1,fill);
+    drawRect(x0,y0+4,5,11,fill);
+}
+
+void N5110::drawVan(int x0,int y0,int fill)
+{
+    drawRect(x0+1,y0,3,1,fill);
+    drawRect(x0,y0+4,5,7,fill);
+}
+
+void N5110::drawMotorcycle(int x0,int y0,int fill)
+{
+    drawCircle(x0+3,y0+3,2,fill);
+    drawRect(x0+2,y0,2,7,fill);
+    drawLine(x0+3,y0+8,x0+3,y0-2,fill);
+    
+}
+
 void N5110::drawHeart(int x0,int y0,int value,int fill)
 {
 
--- a/N5110.h	Tue May 03 10:37:11 2016 +0000
+++ b/N5110.h	Thu May 05 11:33:36 2016 +0000
@@ -322,7 +322,43 @@
     *   @param  fill - 0 transparent (w/outline), 1 filled black, 2 filled white (wo/outline)
     */
     void drawCar (int x0,int y0,int fill);
+    
+    /** Draw Car Up Way Down
+    *
+    *   This function draws a car.
+    *   @param  x0 - x-coordinate of origin (top-left)
+    *   @param  y0 - y-coordinate of origin (top-left)
+    *   @param  fill - 0 transparent (w/outline), 1 filled black, 2 filled white (wo/outline)
+    */
+    void drawCarReverse (int x0,int y0,int fill);
+    
+     /** Draw Truck
+    *
+    *   This function draws a truck.
+    *   @param  x0 - x-coordinate of origin (top-left)
+    *   @param  y0 - y-coordinate of origin (top-left)
+    *   @param  fill - 0 transparent (w/outline), 1 filled black, 2 filled white (wo/outline)
+    */
+    void drawTruck (int x0,int y0,int fill);
 
+    /** Draw Van
+    *
+    *   This function draws a truck.
+    *   @param  x0 - x-coordinate of origin (top-left)
+    *   @param  y0 - y-coordinate of origin (top-left)
+    *   @param  fill - 0 transparent (w/outline), 1 filled black, 2 filled white (wo/outline)
+    */
+    void drawVan (int x0,int y0,int fill);
+
+    /** Draw Motorcycle
+    *
+    *   This function draws a motorcycle.
+    *   @param  x0 - x-coordinate of origin (top-left)
+    *   @param  y0 - y-coordinate of origin (top-left)
+    *   @param  fill - 0 transparent (w/outline), 1 filled black, 2 filled white (wo/outline)
+    */
+    void drawMotorcycle (int x0,int y0,int fill);
+    
      /** Draw Heart Life
     *
     *   This function draws a car.