flaxen icon indicating copy to clipboard operation
flaxen copied to clipboard

Add NapeSystem

Open scriptorum opened this issue 10 years ago • 0 comments

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;
            }
        }
    }

scriptorum avatar May 30 '15 16:05 scriptorum