FlxNapeSpace is a flixel plugin that integrates nape.space.Space to provide Nape physics simulation in Flixel.
Static variables
staticpositionIterations:Int = 10
The number of iterations used by nape in resolving errors in the positions of objects. This is far more lightweight than velocity iterations, as well as being less important for the stability of results. (default 10)
staticread onlyshapeDebug:ShapeDebug
A useful "canvas" which can be used to draw debug information on. To get a better idea of its use, see the official Nape demo 'SpatialQueries' (http://napephys.com/samples.html#swf-SpatialQueries) where this is used to draw lines emitted from Rays. A sensible place to use this would be the state's draw() method. Note that shapeDebug is null if drawDebug is false.
staticvelocityIterations:Int = 10
The number of iterations used by nape in resolving errors in the velocities of objects. This is together with collision detection the most expensive phase of a simulation update, as well as the most important for stable results. (default 10)
Static methods
staticcreateWalls(minX:Float = 0, minY:Float = 0, maxX:Float = 0, maxY:Float = 0, thickness:Float = 10, ?material:Material):Body
Creates simple walls around the game area - useful for prototying.
Parameters:
minX | The smallest X value of your level (usually 0). |
---|---|
minY | The smallest Y value of your level (usually 0). |
maxX | The largest X value of your level - 0 means FlxG.width (usually the level width). |
maxY | The largest Y value of your level - 0 means FlxG.height (usually the level height). |
thickness | How thick the walls are. 10 by default. |
material | The Material to use for the physics body of the walls. |