uses gdip

Screen 640,480,1
sys font= LoadFont ("arial",24)

Function Min(single a, b) as single
iF a <= b  
   Return a 
Else 
   Return b
End iF   
End Function

Function Max(single a, b) as single
iF a >= b 
   Return a 
Else 
   Return b
End iF   
End Function

single x, y, rot, vel, tx, ty, v
single dx, dy, angle, dist, da
sys p1,p2,z

p1= LoadImage "png/kurbis.png",16

While Key(27)=0
  ClsColor 255,0,0,0
  tx = xMouse
  ty = yMouse
  dx = tx-x
  dy = ty-y
  dist = sqr(dx*dx+dy*dy)
  angle = atan(ty-y, tx-x)
  da = angle-rot
  da = atan(Sin(da),Cos(da))
  vel = Min (1, dist/100.0)
  Rot=rot + da*vel*0.1
  x=x + Cos(rot)*vel*5.0
  y=y + Sin(rot)*vel*5.0
  Text font,226,16,"BUMERANG JACK",ARGB 255,440,0,200
  DrawImage p1,x-5,y-5,z
  v= v + .2
  iF v>=1 Then
     v=0
     inc z
     iF z=16 Then z=0
  End iF   
  Flip
  SetFps 60
Wend
Ends