Skip to content

Commit 9500fbc

Browse files
committed
No gravity for sleeping bodies
1 parent e93c40d commit 9500fbc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/physics/arcade/World.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ var World = new Class({
11841184
var allowDrag = body.allowDrag;
11851185
var useDamping = body.useDamping;
11861186

1187-
if (body.allowGravity)
1187+
if (body.allowGravity && !body.sleeping)
11881188
{
11891189
velocityX += (this.gravity.x + body.gravity.x) * delta;
11901190
velocityY += (this.gravity.y + body.gravity.y) * delta;

0 commit comments

Comments
 (0)