A demo based on Terry Ritchies Qb64 Gaming tutorials.
http://www.qb64sourcecode.com/
5 SCREEN 1
10 CALL reset(x1,y1,x2,y2)
45 FOR shade=1 TO 255
46 k=KEY(27)
48 RECT x1,y1,x2,y2,shade,-1
50 count=count+1
70 y1=y1+3
75 x2=x2-3
80 y2=y2-3
85 x1=x1+3
90 IF count>30 THEN CALL reset(x1,y1,x2,y2)
100 IF shade=255 THEN shade=1
105 IF k>0 THEN END
107 NEXT shade
109 END
110 PROC reset(x1,y1,x2,y2)
120 x1=0:y1=0
135 x2=459
140 y2=223
145 count=1
150 RETURN