bplus is into letters now instead of graphics, sad times
OK
@_vince maybe this will cheer your up. ;-))
_Title "Jolly Roger on Fire" 'b+ 2022-01-17
Const xmax
= 500, ymax
= 400
fr = 240 * i / 100 + 15
p&
(i
+ 100) = _RGB(255, fr
, 0) p&
(i
+ 200) = _RGB(255, 255, fr
)xxmax = 500: yymax = 200 'pixels too slow
xstep = xmax / xxmax: ystep = ymax / yymax
Dim f
(xxmax
, yymax
), ff
(xxmax
, yymax
) 'fire array and seed If Point(x
* xstep
, y
* ystep
) = w~&
Then f
(x
, y
) = 300: ff
(x
, y
) = 300
For x
= 1 To xxmax
- 1 'shift fire seed a bit If r
> .9 Then f
(x
, y
) = ff
(x
, y
) For y
= 0 To yymax
- 2 'fire based literally on 4 pixels below it like cellular automata f(x, y) = max((f(x - 1, y + 1) + f(x, y + 1) + f(x + 1, y + 1) + f(x - 1, y + 2)) / 4 - 5, 0)
Line (x
* xstep
, y
* ystep
)-Step(xstep
, ystep
), p&
(f
(x
, y
)), BF
And this might look familiar:
_Title "Jolly Roger on Fire: try spacebar" 'b+ 2022-01-17 Const sw
= 700, sh
= 500, fw
= 600, fh
= 400 Dim i
, fr
, w~&
, jr
, img
, xxmax
, yymax
, xstep
, ystep
, x
, y
, a
, x0
, y0
, r!
fr = 240 * i / 100 + 15
p
(i
+ 100) = _RGB(255, fr
, 0) p
(i
+ 200) = _RGB(255, 255, fr
)
xxmax = fh: yymax = 200
xstep = fw / xxmax: ystep = fh / yymax
Dim f
(xxmax
, yymax
), ff
(xxmax
, yymax
) 'fire array and seed If Point(x
* xstep
, y
* ystep
) = w~&
Then f
(x
, y
) = 300: ff
(x
, y
) = 300
' from _vince flag wave
a = fh / 20
x0 = (sw - fw) / 2 'center flag on screen top left corner
y0 = (sh - fh) / 2
' update the img
If toggle
Then Line (0, 0)-(fw
, fh
), &HFF000000, BF
Else _PutImage , jr&
, img
' blank out image or not either way is interesting For x
= 1 To xxmax
- 1 'refuel fire seed If r!
> .7 Then f
(x
, y
) = ff
(x
, y
) For y
= 0 To yymax
- 2 'fire based literally on 4 pixels below it like cellular automata f(x, y) = max((f(x - 1, y + 1) + f(x, y + 1) + f(x + 1, y + 1) + f(x - 1, y + 2)) / 4 - 5, 0)
Line (x
* xstep
, y
* ystep
)-Step(xstep
, ystep
), p&
(f
(x
, y
)), BF
'source is still img
t = t + 0.2
z
= (0.1 + 0.4 * (x
/ fw
)) * a
* Sin(x
/ 35 - y
/ 70 - t
) + 0.5 * a
dz
= 50 * a
* Cos(x
/ 35 - y
/ 70 - t
) / 35
xx = x + z * 0.707 - a * 0.707
yy = y - z * 0.707
r = r + dz
g = g + dz
b = b + dz
PSet (x0
+ x
, y0
- a
* 0.707 + y
), _RGB(r
, g
, b
) Line (0, 0)-(x0
+ 15, y0
- 4), &HFF000000 Line (0, 1)-(x0
+ 15, y0
- 3), &HFF000000 Line (20, sh
)-(x0
+ 10, y0
- 9 + fh
), &HFF000000 Line (20, sh
+ 1)-(x0
+ 10, y0
- 9 + fh
+ 1), &HFF000000
Zip with bas sources and image