CodeBase - Simple Right Angle Sliding Collision

Return to the CodeBase listing

Category: Collision

Version: 1.0

0
0

Information

Uploaded: 21st Jul 2009 01:06

Modified: 1st Jan 1970 01:00

Author:  Caleb7

Summary

This is a simple technique to perform sliding collision on right angles.

Full Description

This sliding collision only works on right angles. If the target object is not a right angle, sliding collision might not function, but the main object will still stop.<br /> It is important to set the map object's collision to polygons if you would like the intricate collision this method can take. You must put this collision code into the main loop, not in a subroutine! :D Here's how it works:<br /> When the main object collides with the target object, the &quot;for to next&quot; loops the binary values which are multiplied by the differences of the old coordinates and added to the current. When the code has taken its course, the object will be placed where it last was on the proper coordinates only. Make sure your walls are built for the speed that your main object is travelling. If you make them to thin and to fast, you will zip right through em :D God Bless your efforts and may this technique be helpfull!

Comments

No comments yet.