home *** CD-ROM | disk | FTP | other *** search
- on exitFrame
- global h12, v12, x, y, d
- repeat while the stillDown
- set mousehkeep to mouseH()
- set mousevkeep to mouseV()
- set mousex to float(mousehkeep - h12)
- set mousey to float(mousevkeep - v12)
- set mousexy to sqrt((mousex * mousex) + (mousey * mousey))
- if abs(mousex) > 0 then
- set radian to atan(mousey / mousex)
- if mousex < 0 then
- set radian to radian + PI
- end if
- else
- if mousey > 0 then
- set radian to PI / 2
- else
- set radian to -(PI / 2)
- end if
- end if
- if mousexy > 36 then
- set the locH of sprite 13 to h12 + (cos(radian) * 36)
- set the locV of sprite 13 to v12 + (sin(radian) * 36)
- set the castNum of sprite 13 to 32
- else
- set the locH of sprite 13 to h12 + (cos(radian) * mousexy)
- set the locV of sprite 13 to v12 + (sin(radian) * mousexy)
- set the castNum of sprite 13 to 20 + (mousexy / 3)
- end if
- updateStage()
- end repeat
- set dh to float(the locH of sprite 13 - the locH of sprite 12)
- set dv to float(the locV of sprite 13 - the locV of sprite 12)
- if abs(dh) > 0 then
- set radian to atan(dv / dh)
- if dh < 0 then
- set radian to radian + PI
- end if
- else
- if dv > 0 then
- set radian to PI / 2
- else
- set radian to -(PI / 2)
- end if
- end if
- setAt(x, 5, cos(radian))
- setAt(y, 5, sin(radian))
- setAt(d, 5, the castNum of sprite 13 - 20)
- set the castNum of sprite 13 to 0
- end
-