The forums have permanently moved to forum.kirupa.com. 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 8 of 8

Thread: Collision help

  1. Collision help

    Hi,

    Im trying to make a little game in my spare time, I tried using the CDK with the help of Candadian on here I got a mostly working collision setup but it was full of bugs.

    I want to make the image attached. I would like it to be flexible enough to use it again and be able to make a level editor. I can make a simple grid based collision detection set up with just square shapes but the rotated/irregular object in the middle of the illustration does pose quite the problem.

    Any help would be greatly appreciated.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	collison-illustration.jpg 
Views:	21 
Size:	13.8 KB 
ID:	54805  

  2. #2
    Could you be more specific? If your problem is with the irregular shape, you might want to use:

    Code:
    hitObject1.hitTestPoint(hitObject2.x, hitObject2.y, true)
    instead of:
    Code:
    hitObject1.hitTestObject(hitObject2)
    For extra precision.

    More info: http://www.actionscriptmoron.com/?p=1361

  3. I want to be able to test between the red player character in the diagram and the black objects around the stage. the bounding box would make testing for the irregular object in the a little dodgy. I think Im going to use box2D since it seems like the documentation looks a little simpler than NAPE does any one have any idea or suggestions?

  4. #4
    TheCanadian's Avatar
    10,305
    posts
    Noo doot aboot it, eh?
    If you want to do this yourself instead of using a premade collision engine, you should look into the separating axis theorem. Google should give a lot of tutorials on the subject.
    Proud Montanadian
    We tolerate living and breathing. And niches.

    Name Brand Watches

    Maybe getTimer() or TweenMax is the answer to your problem . . .

  5. I am going to go through some separating axis theorem articles, it cant hurt knowing whats happening and how collisions work. To get the collisions working like the set up in the illustration is it better to do it myself or should I use something like box2D

  6. I went through a few articles about separating axis theorem and was alot more straightforward to understand than I first though, my problem is now how would I go about implementing this?

  7. @theCanadian: Ive gone through about 15 of the videos and tests on trig from khan academy and really feel like I can tick trig off my to do list. Thanks for the recommendation

  8. #8
    so I found a fairly simple technique, using movieclips that are rotated and placed around an image then using a little trigonometry you can find the angle and over lap of the line. so just like using a flat surface but then rotate it all round. I found this idea in the as2.0 version of making things move.

Thread Information

Users Browsing this Thread

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

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 kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012