cls
sync on
hide mouse
 
level=1
radius#=(15-level)^2/4.9+20
if radius#<30 then radius#=30
speed#=level^0.7
 
mode=1
 
score=0
hits=0
misses=0
 
targetx=rnd(500)+70
targety=rnd(340)+70                   : rem  |_Move 2____|_Move 3____|_Move  4____|
tarmovvar1=0   : rem Target Move Variable 1  | start x   | start y   | centre x   |
tarmovvar2=0   : rem Target Move Variable 2  | end x     | end y     | centre y   |
tarmovvar3=0   : rem Target Move Variable 2  | direction | direction | angle      |
tarmovvar4#=0  : rem Target Move Variable 4  |     -     |     -     | radius     |
 
tarcmovstep#=0  : rem Target Circular Move Step
 
ink rgb(rnd(100)+150,rnd(100)+150,rnd(100)+150),0
 
do
 
   cls
 
   mx=mousex()
   my=mousey()
   position mouse mx+rnd(6)-3,my+rnd(6)-3
 
   if mx<16 then mx=16
   if my<16 then my=16
   if mx>624 then mx=624
   if my>464 then my=464
 
   if mouseclick()=1
      distance#=sqrt((targetx-mx)^2+(targety-my)^2)
      if distance#<=radius#
         set text size 60
         if distance#<=radius#*0.8
            if distance#<=radius#*0.6
               if distance#<=radius#*0.4
                  if distance#<=radius#*0.2
                     center text 320,100,"BULLSEYE! 50 Points!"
                     score=score+50
                     bullseyes=bullseyes+1
                  else
                     center text 320,100,"40 Points!"
                     score=score+40
                  endif
               else
                  center text 320,100,"30 Points"
                  score=score+30
               endif
            else
               center text 320,100,"20 Points"
               score=score+20
            endif
         else
            center text 320,100,"10 Points"
            score=score+10
         endif
         mode=mode+1
         if mode=2
            targetx=rnd(100)+70
            targety=rnd(340)+70
            tarmovvar1=targetx
            tarmovvar2=rnd(100)+470
            tarmovvar3=1
         endif
         if mode=3
            targetx=rnd(500)+70
            targety=rnd(100)+70
            tarmovvar1=targety
            tarmovvar2=rnd(100)+310
            tarmovvar3=1
         endif
         if mode=4
            repeat
               tarmovvar1=rnd(500)+70
               tarmovvar2=rnd(100)+70
               tarmovvar4#=rnd(200)+50
            until tarmovvar1-tarmovvar4#>70 and tarmovvar2-tarmovvar4#>70 and tarmovvar1+tarmovvar4#<570 and tarmovvar2+tarmovvar4#<410
            targetx=tarmovvar1
            targety=tarmovvar2-radius
            tarmovvar3=270
            tarcmovstep#=360/((tarmovvar4#*6.282)/speed#)
         endif
         if mode=5
            level=level+1
            radius#=(15-level)^2/4.9+20
            if radius#<20 or level>=15 then radius#=20
            print radius#
            speed#=level^0.7
            mode=1
            center text 320,170,"Level Up"
            ink rgb(rnd(100)+150,rnd(100)+150,rnd(100)+150),0
         endif
         hits=hits+1
      else
         set text size 60
         center text 320,100,"Missed! -40 Points"
         score=score-40
         misses=misses+1
      endif
      sleep 500
   endif
 
   if mode=2
      if tarmovvar3=1
         targetx=targetx+speed#
      else
         targetx=targetx-speed#
      endif
      if targetx>tarmovvar2 then tarmovvar3=2
      if targetx<tarmovvar1 then tarmovvar3=1
   endif
 
   if mode=3
      if tarmovvar3=1
         targety=targety+speed#
      else
         targety=targety-speed#
      endif
      if targety>tarmovvar2 then tarmovvar3=2
      if targety<tarmovvar1 then tarmovvar3=1
   endif
 
   if mode=4
      tarmovvar3=wrapvalue(tarmovvar3+tarcmovstep#)
      targetx=tarmovvar1+cos(tarmovvar3)*tarmovvar4#
      targety=tarmovvar2+sin(tarmovvar3)*tarmovvar4#
   endif
 
   circle targetx,targety,radius#
   circle targetx,targety,radius#*0.8
   circle targetx,targety,radius#*0.6
   circle targetx,targety,radius#*0.4
   circle targetx,targety,radius#*0.2
 
   circle mx,my,10
   line mx-15,my,mx-1,my
   line mx+15,my,mx+1,my
   line mx,my-15,mx,my-1
   line mx,my+15,mx,my+1
 
   shots#=(hits+misses)
   hits#=hits
 
   print "SCORE: ";score
   print "LEVEL: ";level
   print
   if shots#>0
      print "Bullseyes: ";bullseyes;", ";bullseyes/hits#*100.0;"%"
      print "Accuracy: ";hits/shots#*100.0;"%"
   endif
 
   sync
 
loop