bubu Posted April 14, 2016 Share Posted April 14, 2016 // boot.js this.game.scale.scaleMode = Phaser.ScaleManager.RESIZE; // game.js game.physics.startSystem(Phaser.Physics.P2JS); //activate physics // Turn on impact events for the world, without this we get no collision callbacks game.physics.p2.setImpactEvents(true); var mySprite = game.add.sprite(100, 100, "ball.png"); game.physics.p2.enable(mySprite); mySprite.body.collideWorldBounds = true; I have a problem with a world bounds collision. I turned on P2 physics, created a sprite, set collideWorldBounds = true and it worked good. But after I changed orientation to album and brought it back to portrait my sprite stopped to collide with world bounds and flew out of the window. I checked the size of game and world bounds. It didn't change, but collision didn't work anymore. Highly appreciate any help to solve this problem. Link to comment Share on other sites More sharing options...
rich Posted April 14, 2016 Share Posted April 14, 2016 This is fixed in the Phaser dev branch (in 2.4.7). It's nothing to do with orientation as such, it was to do with resizing the game world. Link to comment Share on other sites More sharing options...
Recommended Posts