flaxen
flaxen copied to clipboard
Add NapeSystem
Add a NapeSystem for integration with Nape physics.
I should be able to pull what I need from this failed Jam attempt of mine. :)
override public function update(_)
{
nape.step(com.haxepunk.HXP.elapsed);
#if nape // Nape debug
napeDebug.clear();
napeDebug.draw(nape);
napeDebug.flush();
#end
for(node in f.ash.getNodeList(NapeBodyNode))
{
node.position.x = node.body.position.x;
node.position.y = node.body.position.y;
if(node.entity.has(Rotation))
{
var rot = node.entity.get(Rotation);
rot.angle = node.body.rotation * 180 / Math.PI;
}
}
}