summaryrefslogtreecommitdiffstats
path: root/examples/QtSensors/QtSensors_maze/lib.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/QtSensors/QtSensors_maze/lib.js')
-rw-r--r--examples/QtSensors/QtSensors_maze/lib.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/QtSensors/QtSensors_maze/lib.js b/examples/QtSensors/QtSensors_maze/lib.js
index fccce18f..3bae6a86 100644
--- a/examples/QtSensors/QtSensors_maze/lib.js
+++ b/examples/QtSensors/QtSensors_maze/lib.js
@@ -228,19 +228,19 @@ function canMove(x, y)
var dy = ycenter - (idy * cellDimension + ( cellDimension / 2 ));
if (dx > 0){
- if (labyrinth[idx + 1][idy] == 1)
+ if (labyrinth[idx][idy] == 1)
return false;
}
if (dx < 0){
- if (labyrinth[idx - 1][idy] == 1)
+ if (labyrinth[idx][idy] == 1)
return false;
}
if (dy > 0){
- if (labyrinth[idx][idy + 1] == 1)
+ if (labyrinth[idx][idy] == 1)
return false;
}
if (dy < 0){
- if (labyrinth[idx][idy - 1] == 1)
+ if (labyrinth[idx][idy] == 1)
return false;
}
//check if won