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
Namespaces
Methods
-
<static> GetVelocity(delta, vel, accel, friction, max)
-
[description]
Parameters:
Name Type Description deltanumber The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
velnumber [description]
accelnumber [description]
frictionnumber [description]
maxnumber [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 worldPhaser.Physics.Impact.World [description]
leftPhaser.Physics.Impact.Body [description]
rightPhaser.Physics.Impact.Body [description]
weakPhaser.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 worldPhaser.Physics.Impact.World [description]
topPhaser.Physics.Impact.Body [description]
bottomPhaser.Physics.Impact.Body [description]
weakPhaser.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 worldPhaser.Physics.Impact.World The Impact simulation to run the solver in.
bodyAPhaser.Physics.Impact.Body The first body in the collision.
bodyBPhaser.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 bodyPhaser.Physics.Impact.Body [description]
resobject [description]
- Since: 3.0.0
- Source: src/physics/impact/UpdateMotion.js (Line 7)
