_TITLE "Mouse pointer" 'b+ 2020-01-10 CONST xmax
= 800, ymax
= 600, mClr
= &H88FF8844 wandl 0, 0, 0, 0, 1 'this sets a coloring for wand used in drawing the pointer inside the mouse
wandl 0, 0, 0, 0, 1
dx = mx - oldx: dy = my - oldy
oldx = mx: oldy = my
drawMouse mx, my, dx, dy, 30, mClr
'draw a colorful line from point x1, y1, x2, y2 same as you use LINE, use new <> 0 to reset colors
dx = x2 - x1: dy = y2 - y1
distance = (dx ^ 2 + dy ^ 2) ^ .5
dx = dx / distance: dy = dy / distance
x = x1 + i * dx: y = y1 + i * dy
noseX = x
noseY = y
xx
= noseX
- (2 * r
* COS(heading
)) yy
= noseY
- (2 * r
* SIN(heading
)) neckX
= xx
+ .75 * r
* COS(heading
) neckY
= yy
+ .75 * r
* SIN(heading
) tailX
= xx
+ 2 * r
* COS(heading
+ _PI) tailY
= yy
+ 2 * r
* SIN(heading
+ _PI) tailXX
= xx
+ .65 * r
* COS(heading
+ _PI) tailYY
= yy
+ .65 * r
* SIN(heading
+ _PI) earLX
= xx
+ r
* COS(heading
- _PI(1 / 12)) earLY
= yy
+ r
* SIN(heading
- _PI(1 / 12)) earRX
= xx
+ r
* COS(heading
+ _PI(1 / 12)) earRY
= yy
+ r
* SIN(heading
+ _PI(1 / 12)) fcirc xx, yy, .66 * r, c
fcirc neckX, neckY, r * .3, c
ftri noseX, noseY, earLX, earLY, earRX, earRY, c
fcirc earLX, earLY, r * .3, c
fcirc earRX, earRY, r * .3, c
wX
= .5 * r
* COS(heading
- _PI(11 / 18)) wY
= .5 * r
* SIN(heading
- _PI(11 / 18)) wandl noseX, noseY, noseX + wX, noseY + wY, 0
wandl noseX, noseY, noseX - wX, noseY - wY, 0
wX
= .5 * r
* COS(heading
- _PI(7 / 18)) wY
= .5 * r
* SIN(heading
- _PI(7 / 18)) wandl noseX, noseY, noseX + wX, noseY + wY, 0
wandl noseX, noseY, noseX - wX, noseY - wY, 0
LINE (tailXX
, tailYY
)-(tailX
, tailY
), c
_BLEND a&
'<<<< new 2019-12-16 fix
Radius
= ABS(R
): RadiusError
= -Radius: X
= Radius: Y
= 0 LINE (CX
- X
, CY
)-(CX
+ X
, CY
), C
, BF
RadiusError = RadiusError + Y * 2 + 1
LINE (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), C
, BF
LINE (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), C
, BF
X = X - 1
RadiusError = RadiusError - X * 2
Y = Y + 1
LINE (CX
- X
, CY
- Y
)-(CX
+ X
, CY
- Y
), C
, BF
LINE (CX
- X
, CY
+ Y
)-(CX
+ X
, CY
+ Y
), C
, BF