Fliping axis on collision
Hey all, been having this collision issue and i just cant figure out how to fix it. I have a ship the flies around and runs into square walls. Its collision is detected by its bounding box.
The ship's movment rate is stored as velocityX and velocityY, and then the x and y position are updated after the collision testing.
What i want to do is, depending on which side of the ship's bounding box collides with a wall, i want the perpendicular axis to flip. For example, if the top of the ship's bounding box hits a wall, velocityX *= -1.
The one issue i cant fix is if just one corner of the bounding box collides with the wall. For example, if the top left corner hits a wall from above, the check will go through, but what if the wall is to the left, the first check will still go through...
Anyone know of a tutorial that actually has the fliping of the axis? ...any tutorial i've looked for only gave a bollean value of collision, which is not exactly what I need.
Any help would be greatly appreciated as It's for a school project.
|Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Slider to drag another slider on collision||As2 Kills||Actionscript 2.0||1||12-01-2009 08:09 AM|
|Need some help with collision detecting||Hamishman||General Flash||2||02-13-2009 01:45 AM|
|Advanced rectangle collision||prisma||Game Programming||8||08-22-2008 03:44 PM|
|Defining Y Axis||xer0derm||Flash 8||1||01-29-2007 06:41 AM|
|Frame Independent Collision Detection||Canstein33||Flash MX ActionScript||2||04-18-2003 06:10 PM|