deltaluca / nape

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

IsoFunction other than flash target? #83

Closed israelazo closed 10 years ago

israelazo commented 10 years ago

Is any chance that IsoFunction could be available for windows/max/linux target eventually?

i'm using the nape example BodyFromGraphic to build a game and it would be great to compile it to windows

thanks!

deltaluca commented 10 years ago

IsoFunction is only required for flash to work around an issue the flash player has with function closures allocating memory badly.

For non-flash targets the marchingSquares method takes simply a function (x:Float, y:Float):Float as argument.

If you want to target both flash and non-flash with the same code you should do something like:

var iso = new MyIso();
marchingSquaresWhateverTheCodeIs(#if flash iso #else iso.iso #end ...)