as you can see, NAPE is what im looking to use. i had a look at the api, and like the look of it, looks a lot more understandable than box2d. whilst box2d is lovely, its too much for me. but NAPE is a nice option.
the only problem. is that i am just unable to get examples running. constant errors and anything that leads to me nearly getting it to work, it just doesnt.
does anyone have a basic example of nape written in openfl in action? just simple things really
i did also look at these links here, but even those are proving hard to get working as well. which is strange
aye i did try those samples first time round. but have never been able to get them working. i guess if its got all the other cack i dont need, then im bownd to get errors
right. so i quickly worked on a, errr, quick example from what @iconic_stefan had said plus just tried to cut on just what i wanted, which is to work.
but trying it, it comes up with a starnge error message when running. it feel like its about to run, but just doesnt
the error that pops up is Uncaught exception - std@module_read
and i have no idea what that is but has popped up a few times in other physics based tests
so here is a quickie example. as basic as i could think of. but since im not getting a clear message as to what is wrong. say what line, i dont know what to do
package;
import openfl.display.Sprite;
import openfl.events.Event;
import nape.space.Space;
import nape.geom.Vec2;
import nape.phys.Body;
import nape.shape.Circle;
import nape.phys.BodyType;
class Main extends Sprite {
var space:Space;
public function new () {
super ();
addEventListener(Event.ADDED_TO_STAGE, init);
}
public function init(event:Event):Void {
removeEventListener(Event.ADDED_TO_STAGE, init);
stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
var gravity = Vec2.weak(0,600);
space = new Space(gravity);
}
public function setupThings():Void {
var ball = new Body(BodyType.DYNAMIC);
ball.shapes.add(new Circle(60));
ball.position.setxy(50, 50);
ball.angularVel = 10;
ball.space = space;
}
public function onEnterFrame(event:Event):Void {
space.step(1 / stage.frameRate);
}
}
its to neko. but there seems to be a problem with nape talking, or it may be openfl. either way. it doesnt work with neko. which is damn annoying since its nice for quick project building. guess wait and see
aye, thats what i found after some minor digging. though said this was to be fxed, but that was back in march 2014.
urgh, i hope it gets fixed. actually i may just put in an issue request for it to be looked at. would prefer to use nape