sync on : randomize timer()
 
New_Game:
 
set text size 15
 
gosub init_stuff
 
gosub menu
 
gosub Main_Game
 
gosub Target_Round
 
gosub Mirror_Round
 
if score>100 then gosub Bonus_Round
 
gosub Game_Over
 
end
 
 
 
 
`-------------------------------------------------
`SUBROUTINES
`-------------------------------------------------
 
init_stuff:
 
   score=0
 
   ink rgb(255,0,0),0
 
   for x=0 to 49
      for y=0 to 49
         if distance#(x,y,25,25)<=20
            dot x,y
         endif
      next y
   next x
 
   get image 1,0,0,50,50
 
   cls
 
   ink rgb(0,255,0),0
 
   for x=0 to 49
      for y=0 to 49
         if distance#(x,y,25,25)<=20
            dot x,y
         endif
      next y
   next x
 
   get image 2,0,0,50,50
 
   cls
 
   ink rgb(0,0,255),0
 
   for x=0 to 49
      for y=0 to 49
         if distance#(x,y,25,25)<=20
            dot x,y
         endif
      next y
   next x
 
   get image 3,0,0,50,50
 
   cls
 
return
 
 
 
menu:
 
   ink rgb(255,255,255),0
 
   center text 320,50,"The goal of this game is to click as many dots as possible"
   ink rgb(255,0,0),0
   center text 320,100,"Red dots need to be left clicked on"
   ink rgb(0,255,0),0
   center text 320,150,"Green dots need to be right clicked"
   ink rgb(0,0,255),0
   center text 320,200,"Blue dots need to be clicked with both left and right mouse buttons"
   ink rgb(255,255,255),0
   center text 320,250,"You will have 60 seconds to click as many as possible"
 
 
   wait 2000
 
   center text 320,320,"Click to begin"
 
   repeat
   sync
   until mouseclick()=1
 
   cls
 
return
 
 
 
 
 
Game_Over:
 
   cls 0
   ink rgb(255,255,255),0
 
   set text size 40
 
   center text 320,200,"FINAL SCORE -- "+str$(score)
   center text 320,400,"Click for new game"
 
   wait 2000
 
   repeat
   sync
   until mouseclick()=1
 
   goto New_Game
 
return
 
Main_Game:
 
   T=Timer()
 
   ink rgb(255,255,255),0
   set text opaque
 
   do
 
      x=rnd(590) : y=rnd(430) : clicktype=rnd(2)+1
      paste image clicktype,x,y,1
      repeat
         text 10,10, str$(600-((timer()-T)/100))
         text 550,10,"Score - "+str$(score)
         sync
         if 600-((timer()-T)/100)<=0 then exit
      until mouseclick()=clicktype and circlemouseover(x+25,y+25,20)=1
      inc score
      cls
 
      if 600-((timer()-T)/100)<=0 then exit
 
 
   loop
 
   cls
 
return
 
 
 
 
 
Target_Round:
 
   set text size 30
 
   center text 320,200,"Target Round!!!"
   center text 320,250,"HIT AS MANY TARGETS"
   center text 320,290,"AS YOU CAN!!"
 
   sync
 
   wait 1500
 
   cls
 
   dim bonus(108,2)
 
   b=0
   for x=0 to 590 step 50
      for y=0 to 430 step 50
         bonus(b,1)=x
         bonus(b,2)=y
         bonus(b,0)=rnd(2)+1
         inc b
      next y
   next x
 
   set text size 15
 
   T=timer()
 
   repeat
 
   for b=0 to 96
      if bonus(b,0)>0
         paste image bonus(b,0),bonus(b,1),bonus(b,2)
      endif
   next b
   if mouseclick()>0
      mc=mouseclick() : mx=mousex() : my=mousey()
      for b=0 to 108
         if bonus(b,1)<mx and mx<bonus(b,1)+40
            if bonus(b,2)<my and my<bonus(b,2)+40
               if bonus(b,0)>0
                  if mc=bonus(b,0) and clickflag=0
                     bonus(b,0)=0
                     inc score
                     clickflag=1
                  endif
               endif
            endif
         endif
      next b
   else
      clickflag=0
   endif
 
   center text 320,10,"SCORE - "+str$(score)
   text 10,10, str$(150-((timer()-T)/100))
 
   sync
   cls
 
   until 150-((timer()-T)/100)<=0
 
return
 
Mirror_Round:
 
   set text size 20
 
   center text 320,200,"Mirror Round!!!"
   center text 320,240,"Click on the mirror where the dot should be"
 
   ink rgb(100,100,255),0
   box 320,300,639,479
   paste image 1,150,400
   ink 0,0
   line 465,425,480,430
   line 465,425,455,440
   line 480,430,455,440
   line 467,435,470,438
 
   sync
 
   wait 3000
 
   cls
 
   T=Timer()
 
   set text size 15
   set text opaque
 
   do
 
      ink rgb(100,100,255),0
      box 320,0,639,479
      ink rgb(255,255,255),0
 
      x=rnd(270)+340 : y=rnd(430) : clicktype=rnd(2)+1
      paste image clicktype,270-(x-320),y,1
      repeat
         text 10,10, str$(300-((timer()-T)/100))
         text 550,10,"Score - "+str$(score)
         sync
         if 300-((timer()-T)/100)<=0 then exit
      until mouseclick()=clicktype and circlemouseover(x+25,y+25,40)=1
      inc score
      cls
 
      if 300-((timer()-T)/100)<=0 then exit
 
 
   loop
 
 
 
 
 
return
 
 
 
 
 
Bonus_Round:
 
   ink rgb(255,255,255),0
 
   set text size 20
 
   center text 320,200,"BONUS ROUND!!!"
   center text 320,280,"HIT THE TARGET!!!"
 
   wait 1500
 
   cls rgb(0,255,0)
 
   colorflag=0
 
   for rad=50 to 10 step -10
 
      if colorflag=0
         ink rgb(255,0,0),0
      else
         ink rgb(255,255,255),0
      endif
 
      if rad=10 then ink rgb(0,0,255),0
 
      for x=50-rad to 50+rad
         for y=50-rad to 50+rad
            if distance#(50,50,x,y)<=rad then dot x,y
         next y
      next x
 
      colorflag=abs(colorflag-1)
 
   next rad
 
   get image 5,0,0,100,100
 
   cls 0
 
   make object plain 1,10,10
   `ghost object on 1
   texture object 1,5
   xrotate object 1,90
 
   make object plain 2,500,500
   color object 2,rgb(0,255,0)
   xrotate object 2,90
   position object 2,0,-5,0
 
   position camera 0,50,-50
   xrotate camera 90
   camz=-50
 
   repeat
      inc camz
      position camera 0,50,camz
      if mouseclick()=1 then Fire=1 : exit
      sync
   until camz>60
 
   if Fire=1
 
      mx=mousex() : my=mousey()
 
      colorhit=point(mx,my)
 
      if colorhit < (256*256*255)+20
 
         if colorhit<256
 
            rem you hit blue (bullseye)
            inc score, 30
 
         else
 
            rem you hit red
            inc score, 10
 
         endif
 
      else
 
         rem you hit white
         inc score,20
 
      endif
 
   endif
 
   delete object 1 : delete object 2
 
   backdrop off
 
return
 
 
 
 
 
 
 
 
 
 
 
`---------------------------------------------------
`FUNCIONS
`---------------------------------------------------
 
 
function circlemouseover(x,y,rad)
 
   mx=mousex() : my=mousey()
 
   dist#=distance#(mx,my,x,y)
 
   if dist#<=rad then exitfunction 1
 
endfunction 0
 
 
 
function distance#(x1,y1,x2,y2)
 
   dist#=sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1)))
 
   dist#=abs(dist#)
 
endfunction dist#