class flixel.addons.nape.FlxNapeState extends FlxState
Available on all platforms
FlxNapeState is a FlxState that integrates nape.space.Space * to provide Nape physics simulation in Flixel. * Extend this state, add some FlxNapeSprite(s) to start using flixel + nape physics. * Note that space is a static variable, use FlxNapeState.space * to access it. * * @author TiagoLr ( ~~~ProG4mr~~~ )
Class Fields
Instance Fields
The number of iterations used by nape in resolving errors in the positions of objects. This is far more lightweight than * velocity iterations, is well as being less important for the stability of results. (default 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)
Override this method like a normal FlxState, but add * super.create() to it, so that this function is called.
function createWalls(?MinX:Float = 0, ?MinY:Float = 0, ?MaxX:Float = 0, ?MaxY:Float = 0, ?Thickness:Float = 10, ?_Material:Material = null):Body
Creates simple walls around game area - usefull for prototying. * *
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. |