CollisionTest
Test two arrays for collisions
Syntax: CollisionTest(source1[],source2[],dest[],val=1;sizes1=sizeof source1,sizes2=sizeof source2,sized=sizeof dest)
source1
first source array for collision testsource2
second source array for collision testdest
destination array to store result from collision testval
value indicating collision to be stored into destination arraysizes
sizes of all arrays that must be same
Notes: Destination array is cleared prior the operation. Collision is performed by easy condition if (source1[index] && source2[index]) {dest[index]=val}
Returns: returns number of collision points
Example:
if (CollisionTest(a, b)) {....}
test number of collision points without using destif (CollisionTest(a, b, dest, WHITE)) {....}
, test number of collision points and stores WHITE into dest
Last updated
Was this helpful?