| HIT? | |
| Syntax | HIT? [x y] HIT? object |
| Explanation | HIT? performs a hit test on the first
active turtle. Its input may either be a position, which
is a list of the two coordinates X and Y, the name of an
object, or a turtle number. HIT? reports TRUE if the first active turtle
touches the given object or if the position is part of
the image; otherwise HIT? reports FALSE. If
HIT? is used together with turtles or transparent bit
maps, HIT? only tests the portions of the turtle or the
bit map which are visible. This allows for very efficient
hit testing. |
| Examples | ASK 0 [HIT? [0 0]] Result: FALSE ASK 0 [HIT? 1] Result: FALSE HIT? "ROCK Result: TRUE |