How to get a physics engine like Nape working?

Posted by Glacius on Stack Overflow See other posts from Stack Overflow or by Glacius
Published on 2011-01-09T13:10:11Z Indexed on 2011/01/10 2:53 UTC
Read the original article Hit count: 214

Filed under:
|
|
|
|

Introduction: I think Nape is a relatively new engine so some of you may not know it. It's supposedly faster than box2d and I like that there is decent documentation. Here's the site: http://code.google.com/p/nape/

I'm relatively new to programming. I am decent at AS3's basic functionality, but every time I try to implement some kind of engine or framework I can't even seem to get it to work. With Nape I feel I got a little further than before but I still got stuck.

My problem: I'm using Adobe CS5, I managed to import the SWC file like described here. Next I tried to copy the source of one of the demo's like this one and get it to work but I keep getting errors. I made a new class file, copied the demo source to it, and tried to add it to the stage.

My stage code basically looks like this:

import flash.Boot; // these 2 lines are as described in the tutorial
new Boot(); 

var demo = new Main(); // these 2 are me guessing what I'm supposed to do
addChild(demo);

Well, it seems the source code is not even being recognized by flash as a valid class file. I tried editing it, but even if I get it recognized (give a package name and add curly brackets) but I still get a bunch of errors. Is it psuedo code or something? What is going on?

My goal: I can imagine I'm going about this the wrong way. So let me explain what I'm trying to achieve. I basically want to learn how to use the engine by starting from a simple basic example that I can edit and mess around with. If I can't even get a working example then I'm unable to learn anything. Preferably I don't want to start using something like FlashDevelop (as I'd have to learn how to use the program) but if it can't be helped then I can give it a try.

Thank you.

© Stack Overflow or respective owner

Related posts about flash

Related posts about actionscript-3