sync on
sync rate 0
 
DO
`painting
if mouseclick() = 1
   `store old point
   oldx# = mousex() : oldy# = mousey()
   sync
   `if movement then draw
   if mousex() <> oldx# or mousey() <> oldy#
      ink rgb(255,0,0),0
      line oldx#,oldy#,mousex(),mousey()
      `mirror #1
      ink rgb(0,255,0),0
      line (640-oldx#),(480-oldy#),(640-mousex()),(480-mousey())
      `mirror #2
      ink rgb(0,0,255),0
      line oldx#,480-oldy#,mousex(),480-mousey()
      `mirror #3
      ink rgb(255,255,0),0
      line 640-oldx#,oldy#,640-mousex(),mousey()
   endif
endif
 
`when not painting allow screen clear
if mouseclick() <> 1
   if mouseclick() = 2 then cls
   sync
endif
LOOP