09-28-2024, 04:12 PM
(This post was last modified: 09-28-2024, 04:18 PM by Steffan-68.)
What would this look like here?
Star.JPG
or STARS.PNG
Code: (Select All)
'============
'LAVALAMP.BAS
'============
'By Dav, SEP/2024 for QB64PE
Screen _NewImage(1000, 700, 32)
Bild& = _LoadImage(".\star.jpg", 32)
Do
Cls
_PutImage , Bild&, 0
t = Timer * 3 'control speed here
'plasma background
'For y = 0 To _Height Step 2
'For x = 0 To _Width Step 2
'r = Int(128 + 127 * Sin((x * .01) + t))
'g = Int(128 + 127 * Sin((y * .01) + t * 1.2))
'b = Int(128 + 127 * Sin((x * .01) + (y * 0.01) + t * .8))
'Line (x, y)-Step(1, 1), _RGBA(r, g, b, 50), BF
'Next
'Next
'oily plasma blobs
For y = 50 To _Height - 51
For x = 325 To 675
'____________________________
r = Int(128 + 127 * Sin((x * .01) + t))
g = Int(128 + 127 * Sin((y * .01) + t * 1.2))
b = Int(128 + 127 * Sin((x * .01) + (y * 0.01) + t * .8))
'________________________________________
disx = x - _Width \ 2
dixy = y - _Height \ 2
wav = Sin(t + dixy * .05 + disx * .05) * 35
rad = 150 + 50 * Sin(t * 1.5 + dixy * .1) + wav
pulse = 1 + .5 * Sin(t + dixy * .1)
If Sqr(disx ^ 2 / (85 * pulse) ^ 2 + dixy ^ 2 / (rad * pulse) ^ 2) < 1 Then
clr = Int(255 - Sqr(disx ^ 2 + dixy ^ 2) / 2)
Line (x, y)-Step(1, 1), _RGBA(r, g, b, 150), BF '_RGBA(255, clr, clr / 3, 150), BF
End If
Next
Next
'draw top half of lamp
For y = 50 To 350
wfix = (350 - y) / 3
Line (325 + wfix, y)-(675 - wfix, y), _RGBA(255, 255, 100, 50), BF
Next
'draw bottom half of lamp
For y = 351 To 650
wfix = (y - 351) / 3
Line (325 + wfix, y)-(675 - wfix, y), _RGBA(255, 255, 100, 50), BF
Next
'lamp top
Line (425, 20)-(575, 50), _RGB(150, 100, 0), BF
Line (425, 20)-(575, 50), _RGBA(255, 255, 100, 75), B
'lamp base
Line (375, 650)-(625, 700), _RGB(150, 100, 0), BF
Line (375, 650)-(625, 700), _RGBA(255, 255, 100, 75), B
_Display
_Limit 30
Loop Until InKey$ <> ""