Box2d: Bringing 2D physics to screens everywhere
Posted by Fredrik | Filed under 2d, 3d, Actionscript, Adobe Flash, Interaction Design, Lonely Duck, Portfolio, Work, iPhone
What I´m going to write about here is physics in Flash, AS3. And since I like keeping it old school it is 2D physics. Lonely Duck has just finished a small game that you will soon be able to catch in a banner near you. The physics are handled by Box2D, a physics engine ported from C++. When doing physics in AS3 you have a number of different engines to choose from. Even though you are planning to use physics with lets say Papervision3D or any other flash 3d environment you can still use a 2D physics engine, if you keep your objects in one plane with interactions along 2 axis. This means that you won´t be able to support 3d interaction (e.g movement in x,y,z) but in some cases this isn´t really needed.
Anyway, I first gave APE (Actionscript Physics Engine) a go. It was really easy getting started with and the setup of the 2d world and the objects I was going to use worked as expected. After a while (about 50% done) I however found that it was lacking some fundamental stuff that I really wanted. Things like collision detection, a way to avoid tunneling issues and an environment with a more complex collection of different joints and springs. The answer was as I already mentioned Box2D, and even thought the fact that is was a port from C++ first scared me a little (different ways of organizing code, positions and values are on a meter basis, which means that one meter is equal to 30 pixels) now feels great to have started with. Not only because it could be used in many upcoming AS3 projects, it is also possible to use Box2D when developing applications for the iPhone.
There are a number of popular apps out there that uses Box2D for the physics.
These have all been done through porting box2d from C++ to Obj C. Which means writing their own renderers and touch listeners for interaction. Good times however, now there is a released port of the Box2d testbed with working interaction from the touch sensors and the accelerometer. Check out this post explaining things a little bit better here.
Take care!
SIGNAR: Soon in 3D
Posted by Fredrik | Filed under 3d, Actionscript, Adobe Flash, Adobe Flex, Design, Interaction Design
I’ve been writing about trying PV3D for a while now and with the start of my new job it’s time. And when you’re starting to look at the available technologies avaliable like APE, WOW, Away3D, Alternativa 3D and of course Papervision that started the whole thing it’s just mindblowing. It feels like I’m seeing a whole new side of the flash community that I havn’t seen before. It is exciting and I feel great. I am no 3D guy so many of the terms used I’m unfamiliar with but I think I’m starting to get a small grip on it. When I have something to show you guys, I will post it, and try to write how I did it. Until then, take care!
Be the king of Papervision3D!
Posted by Fredrik | Filed under 3d, Actionscript, Adobe Flash, Design

Yesterday I saw that Papervision3D i putting together a competition, PaperKing3D! Many times before I´ve thought of putting together something but just haven´t had the time. But now it´s summer and even though I´ve got some other projects going on I think I will give it a go. After some serious brainstorming I got an idea of what to do, no spoilers yet except that it will show my swedish side but I will keep you updated when things get moving. I hardly think that I´ll have a chance at winning but somehow I always perform better with a goal in sight.
Anyway I think this is a great thing. Can´t wait to see what will be created. I call out on everyone to give it a go!
Lonely Duck HQ
Westin/Johansson Casa