I'm working on some prototypes for a flash game. First of I have to thank Erin for the original Box2D code and Matt for porting it to AS3. You guys rock, hard core!
I've had a lot of fun tweaking and messing with the test bed apps, Erin, it's quite addictive. Right now I've got a stack of boxes from one of your test beds and I'm trying to 'shoot it' to simulate a bullet. At first I made a bullet sized object and sent it careening towards my stack of boxes at hight speed. But it just passed right through before the physics sampling rate can register any collisions. Then I realized that the physical dimensions of an object don't need to correspond to what's rendered on the screen, I made my bullet really long. The collisions register, but often when my lances are halfway through the boxes and the collisions end up weird, or sometimes not at all.
http://www.mechascientific.com/PhysTest.html
Here's my tweaked version of one of the flash test beds. I've managed to attach a graphical MovieClip to my boxes. I hide the bullet render so you don't see a long stick flying through air, and I implemented a damage system on the boxes. If the collision force on a box is over a certain threshold, it decreases the strength of the box and changes the back ground color.
My idea to properly do a bullet collision is to project a line and figure out what the first collision is, then apply a force at that collision point. Any ideas how I can do this with Box2D?
thanks,
Ryan
I've had a lot of fun tweaking and messing with the test bed apps, Erin, it's quite addictive. Right now I've got a stack of boxes from one of your test beds and I'm trying to 'shoot it' to simulate a bullet. At first I made a bullet sized object and sent it careening towards my stack of boxes at hight speed. But it just passed right through before the physics sampling rate can register any collisions. Then I realized that the physical dimensions of an object don't need to correspond to what's rendered on the screen, I made my bullet really long. The collisions register, but often when my lances are halfway through the boxes and the collisions end up weird, or sometimes not at all.
http://www.mechascientific.com/PhysTest.html
Here's my tweaked version of one of the flash test beds. I've managed to attach a graphical MovieClip to my boxes. I hide the bullet render so you don't see a long stick flying through air, and I implemented a damage system on the boxes. If the collision force on a box is over a certain threshold, it decreases the strength of the box and changes the back ground color.
My idea to properly do a bullet collision is to project a line and figure out what the first collision is, then apply a force at that collision point. Any ideas how I can do this with Box2D?
thanks,
Ryan