Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Box2D vehicles

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,171
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 29, 2011

Some vehicles in Box2D as demos for the b2dJson loader.

Source code and tutorials available at http://www.iforce2d.net/b2djson

*** Update: source code for this is now available as an XCode project for the iOS: http://www.iforce2d.net/blog/2011-07-30

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (iforce2d)

  • Any chance you give me come insight on how you made your monster truck tires?

  • @mattbettcher The outer rim is a bunch of small rectangular polygons linked with revolute joints (same as the tank tracks). Each of these polygons is also joined to the center of the wheel with a wheel joint, set up so that the hub of the wheel becomes the 'chassis' body and the small rectangle is the 'wheel' part of the joint.

    Hmm... that sounds a bit confusing huh :)

  • Circles and Friction in box2d are crappy. I use Corona SDK, and suffer issues. I found out I have to make circles like a gears, and change alpha to 0, then overlay a circle over that which is visible to the player.

    The gear "teeth" (i use 16 or 32 teeth) will grip better on the ground. At least that's my experience in Corona SDK, not sure about cocos2d, or whatever you are coding in.

  • @cellphonegaming yeah, the amount of grip feels wrong. Your 'gears' sound a bit like what I tried in my 'platformer trial 5' video (PJogpLrkJqg) although I only have 4 of them :)

    I think you can't rely totally on the physics if you want to get a nice feel. My first approach (see my trials 1-4 videos) was to completely control the character movement myself, but this is a lot of work and has some drawbacks. I think the gears method plus a little additional forces added might be the way to go.

  • amazing work. i've tried to implement walker by myself but all joints were kind of too unstable. So i did it in other way.

  • @andronkolaider yeah, it aint easy. I think this one suffered from not being symmetrical enough. The legs went out of sync, but even if they didn't I doubt it would be very successful. Friction is a problem too, as you've probably noticed - I saw your video a while ago actually, couldn't decide whether that organic-looking style of movement was cute or creepy :)

see all

All Comments (16)

Sign In or Sign Up now to post a comment!
  • @iforce2d no makes perfect sense. Thanks for the insight. I hope to get a working model of my own soon.

  • I made a tank like this a while ago, but keep the track tight with a tension spring. Worked pretty good. I really like your design for the monster truck tires too.

  • I just realized my first post didn't mention the EPIC tank you made, that was what my comments were all based around.

    I want an epic tank so I can run over stuff and yell things. :)

  • @iforce2d I'm new to programming (june 2011, never coded anything before that) and ALL my games are heavy physics based. The trick I've been trying to do is getting a "chain" to wrap around the gear and connect the chain end to end so it's like a motorcycle chain or something. So far, Ive failed HARD to do this :) Basically, the chain breaks apart (I think due to position iterations and box 2d rounding numbers on crunching numbers). Yea, I feel your pain! haha

  • @iforce2d ieah. its little crappy and unusable.maybe i'll think of some modifications.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more