Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

AS3 Collision Resolution


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Hcwool   Members   -  Reputation: 105

Like
0Likes
Like

Posted 13 September 2012 - 04:16 AM

Hey, im trying to figure out collision resolution in as3. I have detection and stuff working i just cant figure out how to resolve it!?! any ideas?

Sponsor:

#2 Deft   Members   -  Reputation: 218

Like
0Likes
Like

Posted 13 September 2012 - 07:04 AM

Collision detection in AS3 is done by call hitTestObject() function. That's all what you need. If you want check collisions for your object continuously - you can test collisions for each frame.
To resolve collisions you need to use some simple mathematics with vectors.
If you need to lock object movement when it's under wall (or floor, or ceiling), you need to check test collision and if it was found, prevent changing object coordinates.
If you need to reflect object movement (as billiard balls, for example), you just need compute movement vector according to simple physics rule. These rules depends on your environment. In simple situation it will be just a ray reflection. Of course, its very primitive methods, if you need more realistic image, you need to know physics laws and formulas. But often for AS3 it's enough.

#3 wildbunny   Members   -  Reputation: 381

Like
0Likes
Like

Posted 14 September 2012 - 09:43 AM

Hey, im trying to figure out collision resolution in as3. I have detection and stuff working i just cant figure out how to resolve it!?! any ideas?


If you're looking for polygonal collision detection and resolution in AS3, I have a couple of articles which might interest you:

http://www.wildbunny.co.uk/blog/2011/04/20/collision-detection-for-dummies/
http://www.wildbunny.co.uk/blog/2011/12/14/how-to-make-a-2d-platform-game-part-2-collision-detection/

Cheers, Paul.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS