Page 1 of 1

Sliding stars v1

Posted: Mon Feb 09, 2015 9:11 pm
by DrChip
REM Sliding Stars - iPhone v1
REM ==================
graphics
DIM starsize(300),starspeed(300)
spacer=5
sw=screen_width()
sh=screen_height()
DIM star(sh+1,7) '/spacer+1,6)
FOR i=1 TO sh/spacer
starsize(i) = 1 'RND(3)+1
next i
loop:
refresh off
graphics clear 0,0,0

FOR i=1 TO sh/spacer
ox=star(i,1)
star(i,1)=star(i,1)-star(i,2)
IF star(i,1)<=1 THEN

star(i,1)=star(i,1)+sw-20
star(i,2)=rnd(5)+1
star(i,3)=rnd(1)
star(i,4)=rnd(1)
star(i,5)=rnd(1)
END IF
fill COLOR star(i,3),star(i,4),star(i,5)
fill circle INT(star(i,1)),i*spacer size starsize(i)

NEXT i

refresh on
GOTO loop