ELEC2645 (2018/19) / Mbed 2 deprecated el17m2h_public

Dependencies:   mbed

Revision:
3:116913e97fd7
Parent:
2:360a6c301a4e
Child:
4:8ec314f806ae
--- a/main.cpp	Wed Apr 10 17:34:02 2019 +0000
+++ b/main.cpp	Wed Apr 10 19:07:41 2019 +0000
@@ -3,8 +3,8 @@
 #include "N5110.h" 
 #include "Engine.h"  
 
-#define FLOORS_WIDTH 2
-#define FLOORS_HEIGHT 10
+#define FLOORS_WIDTH rand() % 15 + 10 // floors width between 10 to 15
+#define FLOORS_HEIGHT 2
 
 // objects
 N5110 lcd(PTC5,PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); // START, LCD SCE, LCD RST, LCD DC, LCD MOSI, LCD CLK, LCD Backlight
@@ -18,7 +18,6 @@
 
 // functions
 int main(){
-    int fps = 8;  // frames per second
     init();     // initialise and then display welcome screen...
     while(1){   
       welcome();
@@ -33,7 +32,7 @@
     // need to initialise LCD and Gamepad 
     lcd.init();
     pad.init();
-    eng.init(FLOORS_HEIGHT, FLOORS_WIDTH);
+    eng.init(FLOORS_WIDTH, FLOORS_HEIGHT);
 }
 
 // Starting menu screen display