mirror of
https://github.com/wassname/phaser.git
synced 2026-07-15 01:11:26 +08:00
Tidied up the docs and removed some Body vars no longer needed. Now to attempt stacking.
This commit is contained in:
@@ -119,11 +119,6 @@ Phaser.Physics.Arcade.Body = function (sprite) {
|
||||
*/
|
||||
this.velocity = new Phaser.Point();
|
||||
|
||||
/**
|
||||
* @property {Phaser.Point} prevVelocity - The velocity in pixels per second sq. of the Body.
|
||||
*/
|
||||
this.prevVelocity = new Phaser.Point();
|
||||
|
||||
/**
|
||||
* @property {Phaser.Point} acceleration - The velocity in pixels per second sq. of the Body.
|
||||
*/
|
||||
@@ -380,12 +375,6 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
this.preY = (this.sprite.world.y - (this.sprite.anchor.y * this.height)) + this.offset.y;
|
||||
this.preRotation = this.sprite.angle;
|
||||
|
||||
// if (this.canSleep && this.sleeping && (this.velocity.equals(this.prevVelocity) === false || this.acceleration.isZero() === false))
|
||||
// {
|
||||
// this.sleeping = false;
|
||||
// this._sleepTimer = 0;
|
||||
// }
|
||||
|
||||
this.x = this.preX;
|
||||
this.y = this.preY;
|
||||
this.rotation = this.preRotation;
|
||||
@@ -407,41 +396,11 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
this.checkWorldBounds();
|
||||
}
|
||||
|
||||
// Apply world gravity, acceleration + rotation
|
||||
this.game.physics.updateMotion(this);
|
||||
|
||||
this.applyMotion();
|
||||
|
||||
// if (this.canSleep)
|
||||
// {
|
||||
// if (!this.sleeping)
|
||||
// {
|
||||
// if (this.velocity.x >= this.sleepMin.x && this.velocity.x <= this.sleepMax.x && this.velocity.y >= this.sleepMin.y && this.velocity.y <= this.sleepMax.y)
|
||||
// {
|
||||
// if (this._sleepTimer >= this.sleepDuration)
|
||||
// {
|
||||
// this.sleeping = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// this._sleepTimer += this.game.time.elapsed;
|
||||
// this.applyMotion();
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// this.applyMotion();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// this.applyMotion();
|
||||
// }
|
||||
}
|
||||
|
||||
this.prevVelocity.copyFrom(this.velocity);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -788,7 +747,6 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", {
|
||||
* @return {number}
|
||||
*/
|
||||
get: function () {
|
||||
// return Math.floor(this.y + this.height);
|
||||
return this.y + this.height;
|
||||
},
|
||||
|
||||
@@ -825,7 +783,6 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", {
|
||||
* @return {number}
|
||||
*/
|
||||
get: function () {
|
||||
// return Math.floor(this.x + this.width);
|
||||
return this.x + this.width;
|
||||
},
|
||||
|
||||
|
||||
@@ -463,9 +463,6 @@ Phaser.Utils.Debug.prototype = {
|
||||
this.splitline('velocity x: ' + sprite.body.velocity.x.toFixed(2), 'y: ' + sprite.body.velocity.y.toFixed(2), 'deltaX: ' + sprite.body.deltaX().toFixed(2), 'deltaY: ' + sprite.body.deltaY().toFixed(2));
|
||||
this.splitline('motion x: ' + sprite.body.motionVelocity.x.toFixed(2), 'y: ' + sprite.body.motionVelocity.y.toFixed(2));
|
||||
this.splitline('bounce x: ' + sprite.body.bounce.x.toFixed(2), 'y: ' + sprite.body.bounce.y.toFixed(2));
|
||||
// this.splitline('sleeping: ' + sprite.body.sleeping, 'sleepTimer: ' + sprite.body._sleepTimer.toFixed(2));
|
||||
// this.splitline('sleepMin x: ' + sprite.body.sleepMin.x, 'y: ' + sprite.body.sleepMin.y);
|
||||
// this.splitline('sleepMax x: ' + sprite.body.sleepMax.x, 'y: ' + sprite.body.sleepMax.y);
|
||||
this.stop();
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user