A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Terrain Collision!

Hybrid View

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    1

    Terrain Collision!

    Im making a bike game thing...
    And Im not sure how to implement the terrain collision
    Heres an idea:
    Code:
      _      _
     / \---/  \
    |   |  |   |
     \_/  __/-/ <collision so move up right wheel and move down left until it touches ground
    ___/
    
    but i dont know how to figure out the rotation/xy coordinates/stuff
    PLEASE HELP :awesome:

  2. #2
    Bacon-wrapped closures Nialsh's Avatar
    Join Date
    Dec 2003
    Location
    Houston!
    Posts
    338
    It depends how realistic you want to get. Like if you drive off a ramp, should the bike stay airborne for a couple of seconds? Should it behave like this game? http://www.miniclip.com/games/trial-bike/en/

    If so, the math is probably very complicated. Rather than reinvent the wheel, you should use a physics engine like Box2D http://box2dflash.sourceforge.net/ Download the file, pick one of their demos and customize it to fit your needs.

    If you're doing something simpler (the ground is smooth; the bike never leaves the ground) then you could probably get away with something simpler.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center