Sign in to follow this  
robertosaget

Help with flash collision detection. Rotating and hiting at the same time

Recommended Posts

hello, Thank you everyone for the help about my previous problem with flash collision detection. The problem i am currently on is a bit more difficult. What i want to do is rotate the object and have it collide. I want the rectangle to rotate so it looks like a diamond and have one of its sides hit the object in a per pixel fashion. From my reading of some books and websites it seems that normal rectangular collision and hitTestObject collision wont do for this problem. I have searched high and low and want to know if anyone has a solution to hit detection with moving and rotating objects. Here is my current collision code with rectangles colboxrect = colbox1.getRect(this); robotrect = robot1.getRect(this); if(robotrect.intersects(colboxrect)) { velocity *=-1; } what i want to happen is when it collides the robot will bounce off of the box. It works but only when it hits it head on. I want it to rotate and be able to hit. I am looking for the flash equivalent of this basically. http://creators.xna.com/en-US/tutorial/collision2dperpixeltransformed thanks for reading and any help you may give

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this