deltaluca / nape

Haxe/AS3 Physics Engine
http://napephys.com
Other
542 stars 78 forks source link

error when running in openfl through neko #94

Closed lewislepton closed 9 years ago

lewislepton commented 9 years ago

howdy

ran into this problem when trying to run NAPE in neko. im using the latest openfl public version along with the latest public haxe version, but this problem occures when using NEKO with a really simple NAPE example

Uncaught exception - std@module_read

ive chatted with a few people, but have decided to post this issue. because i would think that it may be easier to track down this problem. and ive only tried in NEKO and using C++. C++ build worked fine, it built. but have not yet tried with other platforms

here is the simple NAPE code ive typed up. hopefully you can help. id like to use NAPE rather than box2d, the api is much nicer with NAPE ;)

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

thanks ;)

lewislepton commented 9 years ago

fixed this to some degree using this code in my project.xml

<haxedef name="no-inline" />
<haxedef name="dce=full" />

have also put in a error/issue thing so hopefully this can be looked at in a much better way cheers ;)