Author Topic: Fog  (Read 1619 times)

0 Members and 2 Guests are viewing this topic.

Aaron

  • Guest
Fog
« on: March 08, 2014, 07:59:24 AM »
Hello,

some fog.
Code: [Select]
include "gp.inc"
OpenWindow 800,600,1
SetSmoothMode 2

sys xres=800,yres=600,fz
sys cloudx[300]
sys cloudy[300]
sys clouds[300]
w = 300
h = 256
u = LoadImage "png/ufostrip.png",8

For i=1, 300
    cloudx[i] = Rnd(0,xres)
    cloudy[i] = Rnd(0,yres)
    clouds[i] = Rnd(1,4)
Next

Function MoveFog()
For i=1, 300
    Fillcircle cloudx[i], cloudy[i],100,ARGB(80,200,200,200)
    cloudx[i] += clouds[i]
    if cloudx[i] > xres+128
       cloudx[i] = -128
       cloudy[i] = Rnd(0,yres)
       clouds[i] = Rnd(1,4)
    end if
Next
End Function

while KeyDown(27)=0
  clsColor ARGB(25,0,0,0)
  DrawImage u, w, h, fz
  MoveFog
  fz +=1
  if fz=8 then fz=0
  Sync
wend
closewindow()


.