What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.
What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.
We suggest you install the latest version of one of these browsers:
Kongregate is a community-driven browser games portal with an open platform for all web games.
Get your games in front of thousands of users while monetizing through ads and virtual goods.
Learn more »
Hey. I figured out I need to implement Box2D in my game. So I have this test project first when I basically try to draw a ground and a ball that should fall down…
I wrote 120 lines of code to add those and draw them. But they don’t move at all. I’ll post my code to pastebin: [http://pastebin.com/VVmXugyP](http://pastebin.com/VVmXugyP)
You should look at the init funciton and the update function. Drawing works. It’s just that I’d expect that the ball would fall. [It](http://prntscr.com/pi47o) stays still in the air.
Any help would be much appreciated!
> *Originally posted by **[DPbrad](/forums/4/topics/321404?page=1#posts-6765585):***
> circleBodyDef.type = b2Body.b2_dynamicBody
Couldn’t find type in circleBodyDef and neither b2\_dynamicBody in b2Body, but this is the closest I could come:
circleDef.type = b2Body.e_dynamicType;
And it threw `Error #1009` (null object reference) from inside the b2Body class .\_.
Using Box2D 2.02 btw.
> *Originally posted by **[ErlendHL](/forums/4/topics/321404?page=1#posts-6765596):***
> Couldn’t find type in circleBodyDef
Are you using box2Dflash?
I checked, and `type` is defined on line 67 of b2BodyDef. Additionally, `SetType()` is defined on line 897 of b2Body.
For some reason, neither one appears in the online documentation, but they’re definitely there.
I changed the init function to [this](http://pastebin.com/WsMYJX1Q)
It now looks like [this](http://www.fastswf.com/R-QAprI). I think the movement looks really crappy, and when it finally lands on the ground, it keeps ‘shaking’…
> *Originally posted by **[player\_03](/forums/4/topics/321404?page=1#posts-6766709):***
> > *Originally posted by **[ErlendHL](/forums/4/topics/321404?page=1#posts-6765596):***
> > Couldn’t find type in circleBodyDef
> Are you using box2Dflash?
> I checked, and `type` is defined on line 67 of b2BodyDef. Additionally, `SetType()` is defined on line 897 of b2Body.
> For some reason, neither one appears in the online documentation, but they’re definitely there.
It is in Box2D 2.1, but Erlend is using the old version and I don’t think that “type” property of a “b2BodyDef” was implemented in the old version.
Regarding the shakiness Erlend, I would recommend just using the newer Box2D (2.1a). It contains a lot of fixes over the old version and you dont require as many lines of code for the same functionality you desire.