Owen Cavender 201159294

Dependencies:   mbed Gamepad2

Revision:
9:a69a6a06dddf
Parent:
8:997f90c88246
Child:
10:ee781d18e0f6
diff -r 997f90c88246 -r a69a6a06dddf main.cpp
--- a/main.cpp	Thu May 28 18:50:56 2020 +0000
+++ b/main.cpp	Thu May 28 19:16:52 2020 +0000
@@ -29,7 +29,6 @@
 Gamepad pad;
 Snake snake;
 N5110 lcd;
-Apple apple;
 Timer timer;
 GameEngine engine;
 //functions
@@ -61,15 +60,15 @@
         snake.move_snake();
         
         snake.check_collisions();
-        snake.apple_collected(lcd, pad, apple, timer);
+        snake.apple_collected(lcd, pad, timer);
         
-        engine.get_time(timer);
-        engine.get_LEDs(pad);
+        snake.get_time(timer);
+        engine.get_LEDs(pad, snake);
 
 
         gameover_true();
         snake.render(lcd);
-        engine.print_display_time
+        engine.print_display_time(lcd);
        
 
         wait(1.0f/fps);
@@ -85,8 +84,6 @@
     snake.init();           //need to initialise snake class
     pad.init();
     lcd.init();
-    apple.init(48, 24);
-
 }
 
 
@@ -130,7 +127,7 @@
         lcd.clear();
         lcd.refresh();
         lcd.printString( "  Game Over L ", 0, 2 );
-        engine.print_scores(lcd);
+        engine.print_scores(lcd, snake);
 
         if (score <= 7) {
             lcd.printString("    Loser     ", 0,10);