Jump to content

collideWorldBounds different in 2.07?


spencerTL
 Share

Recommended Posts

If I use 2.05 my sprites collide with the world bounds (same size as game).  If I switch out to 2.07, changing nothing else, it doesn't work.  Is there a change to a default value perhaps? I've tried setting and not setting world bounds as well as setting collideWorldBounds.

 

This works in 2.05.  I can leave out the final line as true is default but makes no difference in 2.07.

 

Thanks in advance.

 this.game.world.setBounds(0, 0, 720, 480);    this.game.physics.startSystem(Phaser.Physics.P2JS);    this.game.physics.p2.gravity.y = 0;    this.game.physics.p2.gravity.y = 0;    this.game.physics.p2.restitution =0.8;    this.game.physics.p2.friction = 0.1;         this.hero = this.game.add.sprite(100,100, "w1");             this.game.physics.p2.enable(this.hero );              this.hero.body.fixedRotation = true;              this.hero.body.setCircle(30);             // this.hero.body.collideWorldBounds = true; //makes no difference in 2.05 or 2.07
Link to comment
Share on other sites

Hey SpencerTL,

 

I'm having the same issue as well (but going from .06 to .07).  Haven't figured out the issue yet, but noticed this same behavior in the samples as well:

 

http://examples.phaser.io/_site/view_full.html?d=p2%20physics&f=accelerate+to+object.js&t=accelerate%20to%20object

 

use the version selector to switch between .06 and .07.  the earlier version has all sprites bouncing off the bounds...the newer version has them ignoring the bounds completely.

 

Hopefully will find the issue soon (or someone will beat me to it :) )

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...