Thomas Gill / Mbed 2 deprecated LabyrinthOfTheMinotaur

Dependencies:   N5110 PowerControl mbed

Revision:
7:cd799c701997
Parent:
6:ca5db4353c95
Child:
8:ee857f0147aa
--- a/main.cpp	Fri Apr 17 01:26:50 2015 +0000
+++ b/main.cpp	Fri Apr 17 12:58:04 2015 +0000
@@ -28,6 +28,20 @@
 #define SOUTH 0
 #define EAST 1
 
+struct TILE
+{
+    char    Symbol; // Symbol for this tile
+    bool   Passable; // Can tile be walked on
+};
+
+TILE  TileList[] = {
+    { '#', false },  // 0- WALL
+    { '.', true},  // 1- FLOOR
+    { '+', true }, // 2- ENTER
+    { 'x', true },  // 3- EXIT
+};
+
+
 //Variables
 int buttonFlagA = 0;
 int buttonFlagS = 0;
@@ -52,6 +66,12 @@
 
 int n;
 
+//Space type player is on
+int pSpace;
+
+//Player coordinates
+int px;
+int py;
 
 //Power Saving
 int semihost_powerdown()
@@ -223,7 +243,7 @@
 
                 Neighbours();
 
-                if(n == 1) {
+                if(n < 2) {
                     map[i][j] = WALL;
                 }
             }
@@ -325,10 +345,11 @@
 
     //Initilize screen
     lcd.init();
+    
+    World();
 
     //Game loop
     while(1) {
-        World();
-        wait(4.0);
+        
     }
 }
\ No newline at end of file