Class: Spring

Phaser.Physics. Spring

Physics Spring Constructor

new Spring(game, bodyA, bodyB, restLength, stiffness, damping, worldA, worldB, localA, localB)

Creates a spring, connecting two bodies.

Parameters:
Name Type Argument Default Description
game Phaser.Game

A reference to the current game.

bodyA p2.Body

First connected body.

bodyB p2.Body

Second connected body.

restLength number <optional>
1

Rest length of the spring. A number > 0.

stiffness number <optional>
100

Stiffness of the spring. A number >= 0.

damping number <optional>
1

Damping of the spring. A number >= 0.

worldA Array <optional>

Where to hook the spring to body A, in world coordinates, i.e. [32, 32].

worldB Array <optional>

Where to hook the spring to body B, in world coordinates, i.e. [32, 32].

localA Array <optional>

Where to hook the spring to body A, in local body coordinates.

localB Array <optional>

Where to hook the spring to body B, in local body coordinates.

Source:

Members

game

Properties:
Name Type Description
game Phaser.Game

Local reference to game.

Source:
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the DocStrap template.