Results 1 to 8 of 8
Thread: Collision help
-
May 8th, 2012, 05:19 PM #1881zzz
postsCollision 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.
-
May 8th, 2012, 05:41 PM #219Registered User
postsCould you be more specific? If your problem is with the irregular shape, you might want to use:
instead of:Code:hitObject1.hitTestPoint(hitObject2.x, hitObject2.y, true)
For extra precision.Code:hitObject1.hitTestObject(hitObject2)
More info: http://www.actionscriptmoron.com/?p=1361
-
May 8th, 2012, 06:22 PM #3881zzz
postsI 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?
-
May 8th, 2012, 10:29 PM #4
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 . . .
-
May 9th, 2012, 02:16 AM #5881zzz
postsI 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
-
May 9th, 2012, 01:47 PM #6881zzz
postsI 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?
-
May 9th, 2012, 04:36 PM #7881zzz
posts@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
-
May 10th, 2012, 12:30 AM #8881zzz
postsso 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.

Reply With Quote

Bookmarks