Skip to content

Commit 1c81425

Browse files
committed
Add forceY arguments
1 parent bfdd039 commit 1c81425

1 file changed

Lines changed: 23 additions & 5 deletions

File tree

src/physics/arcade/Body.js

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,16 @@ var Body = new Class({
10031003
this.prev.x = this.x;
10041004
this.prev.y = this.y;
10051005
this.preRotation = this.rotation;
1006+
1007+
if (window.dump)
1008+
{
1009+
console.log('preUpdate v', this.gameObject.name, 'vel', this.velocity.y);
1010+
1011+
if (this.gameObject.name === 'bit01')
1012+
{
1013+
window.dump = false;
1014+
}
1015+
}
10061016
},
10071017

10081018
sleep: function ()
@@ -1099,7 +1109,6 @@ var Body = new Class({
10991109
{
11001110
this.world.updateMotion(this, delta);
11011111

1102-
// World Bounds check
11031112
if (this.collideWorldBounds)
11041113
{
11051114
this.checkWorldRebound();
@@ -1337,6 +1346,11 @@ var Body = new Class({
13371346
wasBlocked.left = worldBlocked.left;
13381347
wasBlocked.right = worldBlocked.right;
13391348

1349+
if (window.dump)
1350+
{
1351+
console.log('postUpdate v', this.gameObject.name, 'vel', this.velocity.y);
1352+
}
1353+
13401354
this.prevVelocity.x = this.velocity.x;
13411355
this.prevVelocity.y = this.velocity.y;
13421356
},
@@ -2108,16 +2122,18 @@ var Body = new Class({
21082122
return this;
21092123
},
21102124

2111-
setBlockedUp: function (by)
2125+
setBlockedUp: function (by, forceY)
21122126
{
2127+
if (forceY === undefined) { forceY = true; }
2128+
21132129
var blocked = this.blocked;
21142130

21152131
blocked.up = true;
21162132
blocked.none = false;
21172133

21182134
this.setBlocker(by);
21192135

2120-
if (!this.forcePosition)
2136+
if (forceY)
21212137
{
21222138
this.y = by.bottom;
21232139
this.forcePosition = true;
@@ -2131,16 +2147,18 @@ var Body = new Class({
21312147
return this;
21322148
},
21332149

2134-
setBlockedDown: function (by)
2150+
setBlockedDown: function (by, forceY)
21352151
{
2152+
if (forceY === undefined) { forceY = true; }
2153+
21362154
var blocked = this.blocked;
21372155

21382156
blocked.down = true;
21392157
blocked.none = false;
21402158

21412159
this.setBlocker(by);
21422160

2143-
if (!this.forcePosition)
2161+
if (forceY)
21442162
{
21452163
this.bottom = by.y;
21462164
this.forcePosition = true;

0 commit comments

Comments
 (0)