Discussion in 'iOS Development' started by tom10122, Apr 26, 2010.
how would i make it so tht when an imag/object collides with something it changes its direction
short of using a full-fledged physics engine, here are some helpful functions:
CGRectContainsPoint() // maybe
thnx how would i use them(me = noob)
well, CGRectIntersectsRect() takes two CGRect structs as arguments, and returns type 'bool' (a C99 type, same as BOOL for our purposes.
get the frames of the two views you want to "check", pass them to the function...evaluate the result in an if statement...simple.
if you have trouble with that, I advise you to take a step back and learn Objective-C (including underlying C language features)
thnx this is perfect
Separate names with a comma.