12-25-2025, 02:58 PM
OK onto 32 bit color, color changing through bplus "plasma" coloring, press Spacebar for different coloring patterns!
Code: (Select All)
_Title "little xmas tree 3" ' b+ 2025-12-24 mod fixes center screen and star
' #2 add color changing, stars and ground
' #3 add "plasma" animations for different lighting: PRESS SPACEBAR...
Screen _NewImage(280, 180, 32)
Dim Shared cN, pR, pG, pB, pA
ResetPal
For star = 1 To 25
Circle (Rnd * 280, Rnd * 180), Int(Rnd * 2)
Next
Line (0, 150)-(280, 180), _RGB32(50), BF
Color _RGB32(255, 255, 0) 'tree star
Line (136, 22)-(140, 12)
Line -(144, 22): Line -(134, 16)
Line -(146, 16): Line -(136, 22)
While _KeyDown(27) = 0
If _KeyDown(32) Then ResetPal
PSet (140 + Cos(0), 20)
For I = 0 To 70 Step 0.01
Line -(I * Cos(I) + 140, 20 - I * (Sin(I) * 0.2 - 2)), Pal~&
Next
_Limit 10
Wend
Function Pal~& ()
cN = cN + 1 ''Dim Shared cN, pR, pG, pB, pA
Pal~& = _RGB32(127 + 127 * Sin(pR * cN), 127 + 127 * Sin(pG * cN), 127 + 127 * Sin(pB * cN),_
127 + 127 * Sin(pA * cN))
End Function
Sub ResetPal ()
''Dim Shared CN, PR, PG, PB, PA
pR = Rnd ^ 2: pG = Rnd ^ 2: pB = Rnd ^ 2: pA = Rnd ^ 2: cN = 0
End Sub
' Merry Christmas QB64 Fans!
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever


