'=========================================================================== ' Subject: SMOOTH SCROLLING WATERFALL Date: 03-04-97 (19:28) ' Author: Nick Kochakian Code: QB, QBasic, PDS ' Origin: NickK@worldnet.att.net Packet: GRAPHICS.ABC '=========================================================================== DECLARE SUB READCOL (red%, green%, blue%, c%) DECLARE SUB palcyc () DECLARE SUB writecol (red%, green%, blue%, c%) 'Water fall ' 'This program uses three routines from my palette program: palsubs.bas 'It also makes a VERY smooth scrolling waterfall! ' '3/2/97 '1997 By: - Nick Kochakian - ' 'Have fun! :) DEFINT A-Z RANDOMIZE TIMER SCREEN 13 X = 1 Y = 1 Col = 255 char = 0 FOR i = 1 TO 255 'Turn off all the colors so you cant see it drawing CALL writecol(0, 0, 0, i) NEXT i DO PSET (X, Y), Col Y = Y + 1 IF Y > 200 THEN Y = 1: X = X + 1: Col = INT(RND * 255) + 1: IF Col < 16 THEN Col = 16 char = char + 1 IF char = 1 THEN Col = Col - 1: char = 0 IF Col < 1 THEN Col = 255 LOOP UNTIL X = 320 FOR i = 1 TO 255 blue% = blue% + 1 IF blue% > 63 THEN blue% = 1 CALL writecol(0, 0, blue%, i) NEXT i CALL palcyc DEFSNG A-Z SUB palcyc 'Nick's palette cycling DO CALL READCOL(ored%, ogreen%, oblue%, 1) FOR P% = 1 TO 254 CALL READCOL(red%, green%, blue%, P% + 1) CALL writecol(red%, green%, blue%, P%) NEXT P% CALL writecol(ored%, ogreen%, oblue%, 255) LOOP UNTIL INKEY$ <> "" END SUB SUB READCOL (red%, green%, blue%, c%) OUT &H3C7, c% red% = INP(&H3C9) green% = INP(&H3C9) blue% = INP(&H3C9) END SUB SUB writecol (red%, green%, blue%, c%) OUT &H3C7, c% OUT &H3C8, c% OUT &H3C9, red% OUT &H3C9, green% OUT &H3C9, blue% END SUB