valueerror Posted March 17, 2014 Share Posted March 17, 2014 http://test.xapient.net/phaser/ALL/ jump right into the first whole (and die) 5 times and suddenly you will fall through the tielmap... no idea what causes it... i will try to setup an easier test environment for this with less code and report here if i find something Link to comment Share on other sites More sharing options...
Alvin Posted March 17, 2014 Share Posted March 17, 2014 I get the bug as well, I'm impressed by how smooth it runs though. Are you sure you're cleaning your states properly (i.e Arrays) ? Link to comment Share on other sites More sharing options...
Mike Posted March 17, 2014 Share Posted March 17, 2014 Huh Yesterday I played the game and at some point Mario started falling trought the floor... I decided that's a developers bug and just refreshed and everything was cool It's nice to know the real reason for this. Link to comment Share on other sites More sharing options...
rich Posted March 17, 2014 Share Posted March 17, 2014 I'd put good money on p2 having run out of bitmasks, so it can't create any more collision groups. To check if this is the case or not, could you try this please: When your state shuts down (so create a state shutdown function if you don't have one already) put this code in:game.physics.p2.world.off("beginContact", game.physics.p2.beginContactHandler, game.physics.p2);game.physics.p2.world.off("endContact", game.physics.p2.endContactHandler, game.physics.p2);game.physics.p2.collisionGroups = [];game.physics.p2._toRemove = [];game.physics.p2.boundsCollidesWith = [];game.physics.p2._collisionGroupID = 2;game.physics.p2.postBroadphaseCallback = null;game.physics.p2.callbackContext = null;game.physics.p2.impactCallback = null; Link to comment Share on other sites More sharing options...
rich Posted March 17, 2014 Share Posted March 17, 2014 Basically the code above is the new P2 'clear' method that's in the dev branch! Link to comment Share on other sites More sharing options...
valueerror Posted March 17, 2014 Author Share Posted March 17, 2014 thx rich... i don't know if i'm doing it right with the shutdown function.. http://test.xapient.net/phaser/swapstateanddie.html here is the smallest example i could think of just run to the right to x>500 to die.. in this example it will happen after the very first state "reload" Link to comment Share on other sites More sharing options...
rich Posted March 17, 2014 Share Posted March 17, 2014 Hah bloody hell, of course. What does P2.clear down? Clears all bodies from the world. What are the world bounds? A body And because p2 already exists, when the state starts again it never gets re-created. If you create your own 'floor' body you'll see it works fine, over and over I think. I'll carry on working through this here. Link to comment Share on other sites More sharing options...
valueerror Posted March 17, 2014 Author Share Posted March 17, 2014 like this .. .that works... http://test.xapient.net/phaser/swapstateanddiefloor.html BUT i think you need to know that in my initial example here http://test.xapient.net/phaser/ALL/ i AM creating my floor body... and after 5!! (why the hell) resets collision is gone.. and it is a tilemap layer !?! Link to comment Share on other sites More sharing options...
rich Posted March 17, 2014 Share Posted March 17, 2014 Ok if you could give the latest dev branch a go I'd appreciate it. I've put up some build files as well in case you're not using grunt. Link to comment Share on other sites More sharing options...
valueerror Posted March 17, 2014 Author Share Posted March 17, 2014 thx for the build file.. didn't find the time (yet) to learn how to work with grunt.. i'd say.. Problem solved in dev branch !! (i've got a few other interesting things for you ^^) did you stumble over this one? http://www.html5gamedevs.com/topic/4406-2-possibe-bugs-with-phaserbutton/#entry27288 thx again for all the work! Link to comment Share on other sites More sharing options...
Recommended Posts