game for 2035

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Revision:
3:664c79e2ceb5
Parent:
2:06c63d567719
Child:
4:af9d6e3b8a29
--- a/map.cpp	Fri Nov 30 02:53:05 2018 +0000
+++ b/map.cpp	Fri Nov 30 03:46:39 2018 +0000
@@ -26,7 +26,7 @@
  * key information (x, y) into a one-dimensional unsigned integer.
  * This function should uniquely map (x,y) onto the space of unsigned integers.
  */
-unsigned XY_KEY(int X, int Y) {
+static unsigned XY_KEY(int X, int Y) {
     unsigned key = X*50+Y;//0.5*(X+Y)*(X+Y+1)+Y;
     return key;
 }
@@ -136,8 +136,7 @@
 
 void map_erase(int x, int y)
 {
-    deleteItem(map[0].items,XY_KEY(x,y));
-    deleteItem(map[1].items,XY_KEY(x,y));
+    deleteItem(get_active_map()->items,XY_KEY(x,y));
 }
 
 void add_wall(int x, int y, int dir, int len)