Scrolling fog/cloud image for moving background
#3
Oh that's a great idea, @bplus!  I did a quick test and that will work perfectly.  Now all I have to do is come up with drawing a good fog.  here's a working test...

- Dav

Code: (Select All)
SCREEN _NEWIMAGE(1000, 600, 32)

fog& = _NEWIMAGE(300, 200, 32)
_DEST fog&
FOR t = 1 TO 20000
    c = RND * 127: x = RND * _WIDTH: y = RND * _HEIGHT
    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
    _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

Find my programs here in Dav's QB64 Corner
Reply


Messages In This Thread
RE: Scrolling fog/cloud image for moving background - by Dav - 05-22-2022, 07:52 PM



Users browsing this thread: 6 Guest(s)