mirror of
https://github.com/wassname/phaser.git
synced 2026-09-11 12:31:29 +08:00
Physics World events added.
Group has new 'addToWorld' parameter, which fulfills the same function as the old useStage. Stage now extends PIXI.Stage rather than owns one.
This commit is contained in:
+4
-4
@@ -37,6 +37,7 @@ Phaser.Physics.Body = function (sprite) {
|
||||
* @protected
|
||||
*/
|
||||
this.data = new p2.Body({ position:[this.px2p(sprite.position.x), this.px2p(sprite.position.y)], mass: 1 });
|
||||
this.data.parent = this;
|
||||
|
||||
/**
|
||||
* @property {Phaser.PointProxy} velocity - The velocity of the body. Set velocity.x to a negative value to move to the left, position to the right. velocity.y negative values move up, positive move down.
|
||||
@@ -48,15 +49,14 @@ Phaser.Physics.Body = function (sprite) {
|
||||
*/
|
||||
this.force = new Phaser.Physics.PointProxy(this.data.force);
|
||||
|
||||
// this.onAdded = new Phaser.Signal();
|
||||
// this.onRemoved = new Phaser.Signal();
|
||||
|
||||
// Set-up the default shape
|
||||
this.setRectangleFromSprite(sprite);
|
||||
|
||||
this.game.physics.addBody(this.data);
|
||||
|
||||
// Set-up contact events
|
||||
// this.sprite.events.onBeginContact = new Phaser.Signal();
|
||||
// this.sprite.events.onEndContact = new Phaser.Signal();
|
||||
|
||||
};
|
||||
|
||||
Phaser.Physics.Body.prototype = {
|
||||
|
||||
Reference in New Issue
Block a user