Edge detections of a backround image

edited November 2013 in How To...

If I draw the background using Photoshop, is there a way to get my character and enemies to avoid touching the "edges" of the background? If so, how?

Tagged:

Answers

  • edited November 2013 Answer ✓

    (Moved to How To, since the question is pretty open.)

    It depends on the edges. If they have all the same color, just use get() at the position about to be attained by the mobile object, and if it is of the color of an edge, it is about to hit it.

    If the image is complex, you might want to draw a simplified, B&W version of the obstacles, to load it in an off-line PImage, and to use get() on this image, instead.

Sign In or Register to comment.