Oh here as an older one, move mouse and change "tunnels" on this crazy satellite:
Code: (Select All)
_Title "Move your mouse" + Space$(53) + "Satellite" 'B+ post 2019-01-10
Const xmax = 600
Const ymax = 600
Screen _NewImage(xmax, ymax, 32)
_ScreenMove 300, 60
map& = _NewImage(xmax, ymax, 32)
'stars& = _LoadImage("stars.png")
r = ymax / 2.5: xc = xmax / 2: yc = ymax / 2: xo = 0
_MouseHide
While _KeyHit <> 27
While _MouseInput: Wend
mx = _MouseX / xmax: my = _MouseY / ymax
_Dest map&
Color , _RGB32(68, 68, 68): Cls
For y = 0 To ymax Step 100
For x = 0 To xmax Step 100
tct x + 3, y + 3, 94, 94, mx, my
Next
Next
'_PutImage , stars&, 0
For y = -r To r
x1 = Sqr(r * r - y * y)
tv = (_Asin(y / r) + 1.5) / 3
For x = -x1 + 1 To x1
tu = (_Asin(x / x1) + 1.5) / 6
_Source map&
pc~& = Point((xo + tu * xmax) Mod xmax, tv * ymax)
_Dest 0
PSet (x + xc, y + yc), pc~&
Next x
Next y
xo = xo - 1 + xmax
xo = xo Mod xmax
_Display
_Limit 10
Wend
Sub tct (x, y, w, h, fx, fy)
mx = fx * w
my = fy * h
dlx = (mx - 1) / 10: drx = (w - mx - 1) / 10: dty = (my - 1) / 10: dby = (h - my - 1) / 10
tx = 0: ty = 0
For i = 10 To 1 Step -1
Line (x + mx - i * dlx, y + my - i * dty)-(x + mx + i * drx, y + my + i * dby), _RGB32(5 * i, 10 * i, 15 * i), BF
Next
Color _RGBA32(155, 140, 40, 120)
xx = x + w - mx: yy = y + h - my
PSet (xx, yy)
tx = 0: ty = 0
While tx < w - drx - dlx
tx = tx + drx
Line -Step(-tx, 0)
ty = ty + dby
Line -Step(0, -ty)
tx = tx + dlx
Line -Step(tx, 0)
ty = ty + dty
Line -Step(0, ty)
Wend
Lightning x + mx, y + my, xx, yy, h
End Sub
Sub Lightning (x1, y1, x2, y2, d)
If d < 5 Then
Color _RGB(225, 225, 245)
Line (x1, y1)-(x2, y2)
Else
mx = (x2 + x1) / 2
my = (y2 + y1) / 2
mx = mx + -.5 * Rnd * d * .4 * rand&&(-2, 2)
my = my + -.5 * Rnd * d * .4 * rand&&(-2, 2)
Lightning x1, y1, mx, my, d / 2
Lightning x2, y2, mx, my, d / 2
End If
End Sub
Function rand&& (lo&&, hi&&)
rand&& = Int(Rnd * (hi&& - lo&& + 1)) + lo&&
End Function
b = b + ...