08-20-2024, 10:54 PM
Code: (Select All)
Screen _NewImage(640, 480, 32)
$Color:32
Do
Cls
Line (100, 100)-(200, 200), Red, BF
Line (300, 100)-(400, 200), Blue, BF
While _MouseInput: Wend
x = _MouseX: y = _MouseY
If x >= 100 And x <= 200 And y >= 100 And y <= 200 Then _PrintString (140, 140), "OK!"
If x >= 300 And x <= 400 And y >= 100 And y <= 200 Then _PrintString (340, 140), "OK!"
_Limit 30
_Display
Loop Until _MouseButton(1)
Let's not forget our little friend 'AND'. This operator is my friend in sooooo many dark places and dangerous alleys.
Cleans up and shortens the code quite nicely.