The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 3 of 3

Thread: Collision Detection fails with AI cars..... :)

  1. #1

    Collision Detection fails with AI cars..... :)

    Hi All,

    I am making a car parking game in flash and AS3 wherein I drive my car along with other AI traffic cars moving along a specified path using Guidelines.

    I had used CDK for collision detection.

    The collision detection works fine with few AI cars, but doesn't seems to be working as required for few AI cars.

    When an AI car is moving on a path in a straight line it works fine.... but when the AI Car turns at 90 degress..... my car goes into the AI car (Overlapping) and it hits at the center of that AI car and then collision is Detected.... .....

    I made a New path and used a new Sprite for AI car... but still the problem pursues....

    any help would be greatly appreciated.....


    Amit ....

  2. #2
    I'm no professional at this but I'm pretty sure I know what the issue is. When you rotate the car the coordinates of your movieclip rotate as well. 0,0 is normally the top left of your movieclip but if you rotate 90 degree clockwise then 0,0 is now the top right of your movieclip. You will probably need to have a separate rectangle defined and use that for your collision detection.

  3. #3
    @ IgiveUp

    All the AI cars that I am using in the game are positioned along the center.... i.e the co-ordinates of the sprites are center aligned...... The problem occurs with the AI car that comes from top left of road and rotates with 90 degrees after covering a certain distance.....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012