Namespace: Impact

Phaser.Physics. Impact

An Impact.js compatible physics world, body and solver, for those who are used to the Impact way of defining and controlling physics bodies. Also works with the new Loader support for Weltmeister map data.

World updated to run off the Phaser main loop. Body extended to support additional setter functions.

To create the map data you'll need Weltmeister, which comes with Impact and can be purchased from http://impactjs.com

My thanks to Dominic Szablewski for his permission to support Impact in Phaser.

Source: src/physics/impact/index.js (Line 7)

Classes

Body
CollisionMap
Factory
ImpactBody
ImpactImage
ImpactPhysics
ImpactSprite
World

Namespaces

COLLIDES
Components
Events
TYPE

Methods


<static> GetVelocity(delta, vel, accel, friction, max)

[description]

Parameters:
Name Type Description
delta number

The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.

vel number

[description]

accel number

[description]

friction number

[description]

max number

[description]

Since: 3.0.0
Source: src/physics/impact/GetVelocity.js (Line 9)
Returns:

[description]

Type
number

<static> SeparateX(world, left, right [, weak])

[description]

Parameters:
Name Type Argument Description
world Phaser.Physics.Impact.World

[description]

left Phaser.Physics.Impact.Body

[description]

right Phaser.Physics.Impact.Body

[description]

weak Phaser.Physics.Impact.Body <optional>

[description]

Since: 3.0.0
Source: src/physics/impact/SeparateX.js (Line 7)

<static> SeparateY(world, top, bottom [, weak])

[description]

Parameters:
Name Type Argument Description
world Phaser.Physics.Impact.World

[description]

top Phaser.Physics.Impact.Body

[description]

bottom Phaser.Physics.Impact.Body

[description]

weak Phaser.Physics.Impact.Body <optional>

[description]

Since: 3.0.0
Source: src/physics/impact/SeparateY.js (Line 7)

<static> Solver(world, bodyA, bodyB)

Impact Physics Solver

Parameters:
Name Type Description
world Phaser.Physics.Impact.World

The Impact simulation to run the solver in.

bodyA Phaser.Physics.Impact.Body

The first body in the collision.

bodyB Phaser.Physics.Impact.Body

The second body in the collision.

Since: 3.0.0
Source: src/physics/impact/Solver.js (Line 12)
Fires:

<static> UpdateMotion(body, res)

Set up the trace-result var res = { collision: {x: false, y: false, slope: false}, pos: {x: x, y: y}, tile: {x: 0, y: 0} };

Parameters:
Name Type Description
body Phaser.Physics.Impact.Body

[description]

res object

[description]

Since: 3.0.0
Source: src/physics/impact/UpdateMotion.js (Line 7)