Scrolling fog/cloud image for moving background
#4
Oh neato.

Code: (Select All)
Screen _NewImage(1000, 600, 32)
_PrintMode _KeepBackground
fog& = _NewImage(300, 200, 32)
_Dest fog&
For t = 1 To 20000
    c = Rnd * 127: x = Rnd * _Width: y = Rnd * _Height
    ff = Rnd * 16 + 3
    Line (x, y)-(x + 4, y + 4), _RGBA(c, c, c, ff), BF
    ' Line (x, y)-(x + 4, y + 4), _RGBA(c, c, c, 15), BF
Next
fog1& = _CopyImage(fog&)
_PutImage (_Width, 0)-(0, _Height), fog1&
fog2& = _CopyImage(fog1&)

_Dest 0
Do
    Locate 15, 15: Print "The fog is pretty cool with variable transparency."
    _PutImage (spos, 0)-(spos + _Width, _Height), fog1&
    _PutImage (spos + _Width, 0)-(spos + (_Width * 2), _Height), fog2&
    spos = spos - 6: If spos <= -_Width Then spos = 0
    _Display
    _Limit 30
Loop
Reply


Messages In This Thread
RE: Scrolling fog/cloud image for moving background - by James D Jarvis - 05-22-2022, 09:01 PM



Users browsing this thread: 8 Guest(s)