BunBunBun Posted March 13, 2014 Share Posted March 13, 2014 I try to make the object is "static" by the following code:sprite.body.mass = 0;orsprite.body.static = true;why the sprite is going to the upper left corner? x and y of the sprite are NaN after this line. I want to create static polygon and check out the collision with dynamic circle. all codes are based on \examples\p2 physics\load polygon 1.jsfunction create() { game.physics.startSystem(Phaser.Physics.P2JS); contra = game.add.sprite(400, 400, 'contra2'); ball = game.add.sprite(380,100, 'ball'); game.physics.p2.enable(contra, true); game.physics.p2.enable(ball, true); ball.body.addCircle(8.5); ball.body.moveDown(200); contra.body.clearShapes(); contra.body.loadPolygon('physicsData', 'contra2'); contra.body.mass = 0;} Link to comment Share on other sites More sharing options...
mooglgamesdev Posted November 19, 2014 Share Posted November 19, 2014 I have the same problemPhaser version 2.0 Link to comment Share on other sites More sharing options...
Recommended Posts