mirror of
https://github.com/wassname/phaser.git
synced 2026-07-01 16:50:43 +08:00
Docs and Examples update.
This commit is contained in:
+51
-14
@@ -398,6 +398,20 @@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
|
||||
class="caret"></b></a>
|
||||
|
||||
<ul class="dropdown-menu ">
|
||||
|
||||
<li>
|
||||
<a href="global.html#SAT">SAT</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1304,10 +1318,10 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
*/
|
||||
separate: function (body, response) {
|
||||
|
||||
if (this.inContact(body))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// if (this.inContact(body))
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
this._distances[0] = body.right - this.x; // Distance of B to face on left side of A
|
||||
this._distances[1] = this.right - body.x; // Distance of B to face on right side of A
|
||||
@@ -1336,11 +1350,11 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
if (response.overlapN.x)
|
||||
{
|
||||
// Which is smaller? Left or Right?
|
||||
if (this._distances[0] < this._distances[1] && (body.checkCollision.right || this.checkCollision.left))
|
||||
if (this._distances[0] < this._distances[1])
|
||||
{
|
||||
hasSeparated = this.hitLeft(body, response);
|
||||
}
|
||||
else if (this._distances[1] < this._distances[0] && (body.checkCollision.left || this.checkCollision.right))
|
||||
else if (this._distances[1] < this._distances[0])
|
||||
{
|
||||
hasSeparated = this.hitRight(body, response);
|
||||
}
|
||||
@@ -1348,11 +1362,11 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
else if (response.overlapN.y)
|
||||
{
|
||||
// Which is smaller? Top or Bottom?
|
||||
if (this._distances[2] < this._distances[3] && (body.checkCollision.down || this.checkCollision.up))
|
||||
if (this._distances[2] < this._distances[3])
|
||||
{
|
||||
hasSeparated = this.hitTop(body, response);
|
||||
}
|
||||
else if (this._distances[3] < this._distances[2] && (body.checkCollision.up || this.checkCollision.down))
|
||||
else if (this._distances[3] < this._distances[2])
|
||||
{
|
||||
hasSeparated = this.hitBottom(body, response);
|
||||
}
|
||||
@@ -1390,9 +1404,14 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
*/
|
||||
hitLeft: function (body, response) {
|
||||
|
||||
if (!this.checkCollision.left || !body.checkCollision.right)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.collideCallback && !this.collideCallback.call(this.collideCallbackContext, Phaser.LEFT, this, body, response))
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.moves || this.immovable || this.blocked.right || this.touching.right)
|
||||
@@ -1416,6 +1435,8 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
this.touching.left = true;
|
||||
body.touching.right = true;
|
||||
|
||||
return true;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1432,9 +1453,14 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
*/
|
||||
hitRight: function (body, response) {
|
||||
|
||||
if (!this.checkCollision.right || !body.checkCollision.left)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.collideCallback && !this.collideCallback.call(this.collideCallbackContext, Phaser.RIGHT, this, body))
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.moves || this.immovable || this.blocked.left || this.touching.left)
|
||||
@@ -1458,6 +1484,8 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
this.touching.right = true;
|
||||
body.touching.left = true;
|
||||
|
||||
return true;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1474,6 +1502,11 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
*/
|
||||
hitTop: function (body, response) {
|
||||
|
||||
if (!this.checkCollision.up || !body.checkCollision.down)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.collideCallback && !this.collideCallback.call(this.collideCallbackContext, Phaser.UP, this, body))
|
||||
{
|
||||
return false;
|
||||
@@ -1518,6 +1551,11 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
*/
|
||||
hitBottom: function (body, response) {
|
||||
|
||||
if (!this.checkCollision.down || !body.checkCollision.up)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.collideCallback && !this.collideCallback.call(this.collideCallbackContext, Phaser.DOWN, this, body))
|
||||
{
|
||||
return false;
|
||||
@@ -1605,10 +1643,10 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
|
||||
if (this.moves)
|
||||
{
|
||||
this.reboundCheck(true, true, true);
|
||||
|
||||
this.game.physics.checkBounds(this);
|
||||
|
||||
this.reboundCheck(true, true, true);
|
||||
|
||||
this._dx = this.deltaX();
|
||||
this._dy = this.deltaY();
|
||||
|
||||
@@ -1645,7 +1683,6 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
{
|
||||
this.updateScale();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
@@ -1954,7 +1991,7 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "y", {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
|
||||
on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user