Working Springs demo.

This commit is contained in:
photonstorm
2014-02-15 02:56:24 +00:00
parent e5812710cc
commit 9837984a4d
2 changed files with 96 additions and 4 deletions
+4 -4
View File
@@ -38,22 +38,22 @@ Phaser.Physics.Spring = function (game, bodyA, bodyB, restLength, stiffness, dam
damping: damping
};
if (typeof worldA !== 'undefined')
if (typeof worldA !== 'undefined' && worldA !== null)
{
options.worldAnchorA = [ game.math.px2p(worldA[0]), game.math.px2p(worldA[1]) ];
}
if (typeof worldB !== 'undefined')
if (typeof worldB !== 'undefined' && worldB !== null)
{
options.worldAnchorB = [ game.math.px2p(worldB[0]), game.math.px2p(worldB[1]) ];
}
if (typeof localA !== 'undefined')
if (typeof localA !== 'undefined' && localA !== null)
{
options.localAnchorA = [ game.math.px2p(localA[0]), game.math.px2p(localA[1]) ];
}
if (typeof localB !== 'undefined')
if (typeof localB !== 'undefined' && localB !== null)
{
options.localAnchorB = [ game.math.px2p(localB[0]), game.math.px2p(localB[1]) ];
}