Adam Baker 201166301

Dependencies:   mbed Gamepad N5110

Revision:
9:ddeafaadf984
Parent:
8:44678962ec01
Child:
10:a37a4d2c09e7
--- a/main.cpp	Sat Mar 23 12:01:20 2019 +0000
+++ b/main.cpp	Sat Mar 23 12:41:30 2019 +0000
@@ -3,16 +3,17 @@
 #include "N5110.h"
 #include "Runner.h"
 #include "Levels.h"
-
+#include "Animation.h"
 
 N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
 Gamepad pad;
 Runner runner;
+Animation ani;
 
 
 int main() {
     
-    int fps = 12;
+    int fps = 5;
     
     pad.init();
     lcd.init();
@@ -25,29 +26,9 @@
 
         lcd.clear();
         
-        lcd.drawCircle(move.x,move.y,3,FILL_BLACK);
-        /**
-        const int fueltank[14][20] =   {
-            { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
-            { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
-            { 0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1},
-            { 0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1},
-            { 0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,0,0,1,1,0},
-            { 0,0,0,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,0,0},
-            { 0,0,0,1,0,0,1,0,0,0,0,1,0,1,1,0,1,1,0,0},
-            { 0,0,0,1,0,0,1,1,1,0,0,1,0,1,1,0,0,1,1,0},
-            { 0,0,0,1,0,0,1,0,0,0,0,1,0,1,1,0,0,1,1,0},
-            { 0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0},
-            { 0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,0,0,1,1,0},
-            { 0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,0,0},
-            { 0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0},
-            { 0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},
-        };
-        
-        lcd.drawSprite(x,y,14,20,(int *)fueltank);
-        */
-        
-        
+        //lcd.drawCircle(move.x,move.y,3,FILL_BLACK);
+        ani.standing(move.x, move.y, lcd);
+    
         
         move = runner.nextLevel(move); //must happen befofre 'fall' otherwise runner can fall out of screen 
         
@@ -69,7 +50,7 @@
         
     
  
-        move = runner.fall(move, lcd);
+        move = runner.fall(move);
         
     
         
@@ -78,7 +59,7 @@
         lcd.printString(buffer,0,1);
         */
         char buffer1[14];
-        sprintf(buffer1,"%i",move.l);
+        sprintf(buffer1,"%i",move.gp);
         lcd.printString(buffer1,0,0);