Commits

Anonymous committed 35fb2ea

two levels now implemented, no difficulty yet.

  • Participants
  • Parent commits 6cd84ed

Comments (0)

Files changed (2)

File application.js

     var currentLevelData = undefined;
     var load = function(levelData) {
         currentLevelData = levelData;
-        var level = JSON.parse(currentLevelData);
-        space2d.loadWorld(level);
-        space3d.loadWorld(level);
-        editor2d.loadWorld(level);
+        if( currentLevelData ) {
+            var level = JSON.parse(currentLevelData);
+            space2d.loadWorld(level);
+            space3d.loadWorld(level);
+            editor2d.loadWorld(level);
+        }
     }
 
     var currentLevelNumber = -1;
 
     var objectiveHandler = function(success) {
         console.log("objective success?:",success);
+        next();
     }
 
     var levelLoader = {load:load, restart:restart, next:next, previous:previous};
 define([],function() {
 
     var stack = [];
+
     stack.push('{"structure":[{"warpHoleId":8,"isWarpHole":true,"isOpen":false,"x":7.769230842590332,"y":0.3076923191547394},{"isBall":true,"ballType":"red","x":-7.692307472229004,"y":0.6538461446762085},{"isGround":true,"x":0,"y":0.09615384787321091,"x1":7.846153846153846,"y1":-0.21153846153846156,"x2":-7.846153846153846,"y2":0.21153846153846156}],"objective":["red"]}');
 
+    stack.push('{"structure":[{"isBall":true,"ballType":"green","x":-7.615384578704834,"y":0.6923076510429382},{"isGround":true,"x":0,"y":0.09615384787321091,"x1":7.846153846153846,"y1":-0.21153846153846156,"x2":-7.846153846153846,"y2":0.21153846153846156},{"isBall":true,"ballType":"red","x":-6.692307472229004,"y":0.692307710647583},{"warpHoleId":8,"isWarpHole":true,"isOpen":false,"x":7.769230842590332,"y":0.3076923191547394}],"objective":["red","green"]}');
+
     return {
         get: function(index) { return stack[index]; }
     }