0

I've made a character, and used the bone tool to make it move in runtime.

This works fine, but now I want to add gravity/physics, so I can throw my character and it lands on the ground like a real ragdoll. How do I do this in actionscript 3 ? And is it possible to do this within the fla (no class file).

Thanks in advanced!

casperOne
  • 73,706
  • 19
  • 184
  • 253
Tim Lodder
  • 49
  • 1
  • 12

1 Answers1

0

I'm not a bones tool expert but it's really really really unlikely.

You can do it without the class file, coding only on the timeline, but not without code, which is probably what you asked.

http://box2dflash.sourceforge.net/

This is FlashBox2D, physics engine for flash based on a C++ engine by Erin Cato. Since you asked whether it can be done without the class file, you should probably pass over over this particular engine since C++ programing is very complicated because of the way C++ programing "pros" force you to micromanage every minute detail of the program for ultimate in memory management. Just creating a basic circle shaped body is on the order of 10-15 lines of code. Creating the world is close to that as well. Luckily, there is copy paste.

I don't know if other engines are less verbose (they should be), but I suggest you check them out as well, in case one of those suits you more.

Nice thing is that you can just reuse their example code for your needs if you can get your head around it.

http://www.flashrealtime.com/flash-game-library-engine-list/#Physics

Have fun.

Neoraptor
  • 951
  • 1
  • 7
  • 13
  • I've tried an engine, but I couldn't get it working in combination with a boned-charactermovieclip and it's in comparison pretty slow. I want to use it on the iOS. But without that in mind, I can't get it to work with help of the documentation and the example. – Tim Lodder Oct 08 '11 at 13:56
  • If you can acess the bones data through actionscript you can tie in any code you want into it. There is a good chance you can't though, it's probably just a flash IDE helper object to create graphics, i am not familiar with any "bones" code in AS. You'll need to see if you can move MCs around with bones. If you can, you can tie the bones animation to the physics engine using mc's as points. If you can't, you'll need to forget about bones, more or less, and learn a physics engine. Aded to the fact that you probably are not a great programmer (sorry if I'm mistaken) it probalby means you should – Neoraptor Oct 08 '11 at 14:28
  • forget the ios thing. I was informed it takes a lot of performance tweaks with bitmapdata cashing for anything non simple... sorry if I am being rude :) Don't go into it unless you have nerves of steel... – Neoraptor Oct 08 '11 at 14:29
  • google for examples. There is a metric ton for physics engines. You won't find any for bones + physics probably though. – Neoraptor Oct 08 '11 at 14:32