Commits

Anonymous committed f265943

only the floor triggers a level failure on ball collision

Comments (0)

Files changed (2)

         return ground;
     }
 
-    var createWall = function( world, centerx, centery, horizontal, vertical ) {
+    var createWall = function( world, centerx, centery, horizontal, vertical, dontTouch ) {
         var bd_ground = new Box2D.b2BodyDef();
         bd_ground.set_position( new Box2D.b2Vec2(centerx,centery) );
         var ground = world.CreateBody(bd_ground);
         ground.userData = {
             attributes: {
                 isWall: true,
+                dontTouch: dontTouch,
                 x: centerx,
                 y: centery,
                 horizontal: horizontal,
         bodies.createGround(world, centerx, centery, x1, y1, x2, y2);
     }
 
-    var createWall = function(centerx, centery, horizontal, vertical) {
-        bodies.createWall(world, centerx, centery, horizontal, vertical);
+    var createWall = function(centerx, centery, horizontal, vertical, dontTouch) {
+        bodies.createWall(world, centerx, centery, horizontal, vertical, dontTouch);
     }
 
     var world = undefined;
                 createGround(object.x, object.y, object.x1, object.y1, object.x2, object.y2);
             }
             else if( object.isWall ) {
-                createWall(object.x, object.y, object.horizontal, object.vertical);
+                createWall(object.x, object.y, object.horizontal, object.vertical, object.dontTouch);
             }
             else if( object.isWarpHole ) {
                 createWarpHole( object.warpHoleId, object.x, object.y );
 
     var clearWorld = function() {
         world = newWorld();
-        createWall(0,-6.7*2,18*2,0);
-        createWall(0,6.7*2,18*2,0);
-        createWall(9*2,0,0,13.4*2);
-        createWall(-9*2,0,0,-13.4*2);
+        createWall(0,-6.7*2,18*2,0,true);
+        createWall(0,6.7*2,18*2,0,false);
+        createWall(9*2,0,0,13.4*2,false);
+        createWall(-9*2,0,0,-13.4*2,false);
     }
 
     var fixtureToUserData = function(f) {
                 }
             }
             else if( fixtureToUserData(a).attributes.isWall ) {
-                notifyObjective(false);
+                if( fixtureToUserData(a).attributes.dontTouch ) {
+                    notifyObjective(false);
+                }
             }
         }
         else if( fixtureToUserData(a).attributes.isBall ) {
                 }
             }
             else if( fixtureToUserData(b).attributes.isWall ) {
-                notifyObjective(false);
+                if( fixtureToUserData(b).attributes.dontTouch ) {
+                    notifyObjective(false);
+                }
             }
         }
     }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.