I like...
sync on
ax= 100 : ay= 100
bx= 200 : by= 150
box ax,ay,bx,by
xmid= (ax+bx)/2
xlen= abs(ax-bx)/2
ymid= (ay+by)/2
ylen= abs(ay-by)/2
DO
mx= mousex() : my= mousey()
if mouseclick()=1
if abs(mx-xmid)<xlen and abs(my-ymid)<ylen
print "ouch! ";
endif
endif
sync
LOOP
I like it because it detects how far away the cursor is from a specified point (the middle of the square) and compares that to how wide/high the square is. Rather than checking minimums and maximums for both axis.
(what is the plural of axis?)
The Universe has been erased by a mod because it was larger
than 240x80 pixels.