Jump to content

p2 physics


guddy
 Share

Recommended Posts

Hi,

I have add p2 physics to the sprite .But my sprite floating in air ,is not still in one place .I have use

 sprite.body.setZeroDamping();
 sprite.body.fixedRotation = true;
but it not working 
 
my code 
 
  this.image = 'block'+this.Level1[pos];
  this.cow = configObj.game.add.sprite(this.Xpos[pos], this.Ypos[pos], this.image);
  configObj.game.physics.p2.enable([this.cow]);
  this.cow.body.setZeroDamping();
  this.cow.body.fixedRotation = true;
  this.cow.inputEnabled = true;
  this.cow.events.onInputDown.add(this.mouseDownCallBack, this);
 this.cow.events.onInputUp.add(this.mouseUpCallBack, this);
 
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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