AreThingsOverlapping(int thing1, int thing2)
Checks whether two characters or objects are overlapping each other on screen. This simply
carries out a quick rectangular check on the two things to decide - so if they have large
transparent regions around the edges, it may seem to be overlapping too soon.
THING1 and THING2 can either be a CHARID, or can be an object number PLUS 1000.
So for example, passing EGO as THING1, and 1004 as THING2, will compare the character EGO
with Object 4 in the current room.
Returns 0 if they are not overlapping, or the overlapping amount if they are. This amount
is an arbitrary scale, but 1 means they are just about touching, all the way up to higher numbers
for more overlappingness.
Calling this function with both the parameters as objects is the same as calling Object.IsCollidingWithObject.
Example:
if (AreThingsOverlapping(1002, EGO)) {
// code here
}
will run the code if object 2 is overlapping EGO. This could be useful if object 2 was a bullet,
for instance.
See Also: Character.IsCollidingWithChar,
Object.IsCollidingWithObject
|