Thread: testnpc
View Single Post
  #10  
Old 01-18-2006, 03:12 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Yen
Shouldn't you use 'else' in the 'overlaps' function??
Well, the last 4 you could combine to the first four, but only using an else if... other than that, they're checking four different coordinates on two different rectangles. Only case you could make to use else if is

if (first coordinate in first rectangle in second rectangle's range)
else if (first coordinate in second rectangle in first rectangle's range)

if (second coordinate in first rectangle in second rectangle's range)
else if (second coordinate in second rectangle in first rectangle's range)

or wait... yea you could... but I don't think it's quite necessary in a return bool function.
Reply With Quote