01-16-2023, 04:13 PM
Recurring Squares
Code: (Select All)
_Title "recurring squares 2017-10-26 by bplus"
' Now with Alpha coloring!
'reoccuring squares SmallBASIC translation from
Rem reoccuring squares NaaLaa started 2015-05-14 MGA/B+
Const xmax = 700
Const ymax = 700
Screen _NewImage(xmax, ymax, 32)
_ScreenMove 360, 30 'adjust as needed _MIDDLE needs a delay .5 or more for me
Common Shared dimmer
sq = 700: dir = 1
While 1
Cls
white& = _RGB32(255, 255, 255)
fRecStep 0, 0, sq, sq, white&
sqPlus sq / 2, sq / 2, sq / 2
_Display
_Limit 30
dimmer = dimmer + dir
If dimmer > 255 Then dimmer = 255: dir = dir * -1: _Delay .5
If dimmer < 0 Then dimmer = 0: dir = dir * -1: _Delay .5
Wend
Sub fRecStep (x1, y1, x2, y2, c&)
Line (x1, y1)-Step(x2, y2), c&, BF
End Sub
Sub sqPlus (x, y, side)
cx = x - side / 2: cy = y - side / 2
fRecStep cx, cy, side, side, _RGBA32(0, 0, 0, dimmer)
If side < 10 Then Exit Sub
ns = side / 2: nc = colorNumber - 35
sqPlus cx, cy, ns
sqPlus cx + side, cy, ns
sqPlus cx, cy + side, ns
sqPlus cx + side, cy + side, ns
End Sub
b = b + ...