Declaration: I have read the University Regulations on Plagiarism [1] and state that the work covered by this declaration is my own and does not contain any unacknowledged work from other sources. I understand that my code will be run through a source code plagiarism detection engine and will be compared to all code submitted in this module (both in Leeds and at the Joint School in China). I confirm my consent to the University copying and distributing any or all of my work in any form and using third parties (who may be based outside the EU/EEA) to monitor breaches of regulations, to verify whether my work contains plagiarised material, and for quality assurance purposes. I confirm that details of any mitigating circumstances or other matters which might have affected my performance and which I wish to bring to the attention of the examiners, have been submitted to the Student Support Office. [1] Available on the School Student Intranet

Dependencies:   mbed Gamepad N5110 Joystick

Revision:
3:660de4311976
Parent:
2:0bd6711eae26
Child:
4:0fc3441556e1
--- a/main.cpp	Wed May 08 21:26:27 2019 +0000
+++ b/main.cpp	Thu May 09 00:19:35 2019 +0000
@@ -22,7 +22,9 @@
 // Instances
 GameEngine engine;
 
+
 int main() {
+    srand(time(NULL));
     Init(); 
     Welcome();
     engine.init();
@@ -33,6 +35,7 @@
         render();
         engine.get_dir(gamepad);
         engine.snake_move();
+        engine.food_move();
     }
 }
 
@@ -67,5 +70,5 @@
     lcd.clear();
     engine.draw(lcd);
     lcd.refresh();
-    wait(1.0);
+    wait(0.2);
 }
\ No newline at end of file