A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Advance car collisions ?

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    3

    Lightbulb Advance car collisions ?

    Hi everybody,
    I´m new here. Three days ago I started developing a top-car driving game. Car movement, and collision test was OK, but now i want to make some "effect" after collision. In real world, car change direction and rotation after crash. Can anyone help me to resolve problem with collisions? I also want to resolve problem when you crash into the wall in low speed, car should slide around the wall. I don´t know how to describe my problem soo, imagine box2D crashe physic. I need to do something like that, but without using any Physical engine. Something like game below without using physical engine http://www.emanueleferonato.com/down...wheeledcar.swf

    Car movement is done with this code:
    Rotation:
    this._rotation += rychlost*wheel_angle*0.01;
    wheel_angle is beetwen 30 and -30
    X and Y cordination:
    this._x = this._x+Math.sin(this._rotation*(Math.PI/180))*speed;
    this._y = this._y-Math.cos(this._rotation*(Math.PI/180))*speed;
    speed is beetweb 10 and -4

    Thanks everybody for help and excuse my bad english.

    PS: Is there a way to made this type of collisions without physic engine ?

    If anybody want help me, please write here.

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Your link doesn't work.
    What's so wrong about using a physics engine to simulate (*gasp*) physics?
    Your code appears to be AS2, but you posted in the AS3 forum.

  3. #3
    Junior Member
    Join Date
    Dec 2009
    Posts
    3
    Hi,
    Sorry for that link, here is working link:
    http://www.osmdam.wz.cz/wheeledcar.swf

    I don´t think that there is something bad abou using physic engine, I just want to do it by my self. I tryed to use mathematical funcions, but result was terrible. So i asking for help.
    Last edited by SmokeKiller; 03-06-2010 at 02:30 AM.

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