Rain
Posted: Fri Apr 03, 2015 6:42 am
Code: Select all
rem rain - a simple raindrop effect
rem iPhone 6 Plus / 8.3 b4
rem Enjoy...
graphics
sw=screen_width()
sh=screen_height()
md=10 ' number of rain drops
dropsize = 40 ' max size of rain drops
dim dropx(md+1)
dim dropy(md+1)
dim dropr(md+1)
for a=1 to md
dropx(a)=rnd(sw)
dropy(a)=rnd(sh)
dropr(a)=rnd(dropsize)
next a
loop:
refresh off
graphics clear 0,0,50/255
for a=1 to md
bri=250-dropr(a)*5
draw color 0,0,bri/255
draw circle dropx(a),dropy(a) size dropr(a)
dropr(a)=dropr(a)+1
if dropr(a)>dropsize then
dropx(a)=rnd(sw)
dropy(a)=rnd(sh)
dropr(a)=0
end if
next a
refresh on
goto loop