Jump to content
  • Advertisement
Sign in to follow this  
Hcwool

AS3 Collision Resolution

This topic is 2138 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!