Color Cycling

 BBS: Inland Empire Archive
Date: 04-01-92 (22:32)             Number: 110
From: JEAN CREPEAU                 Refer#: NONE
  To: MONTE FERGUSON                Recvd: NO  
Subj: Color Cycling                  Conf: (2) Quik_Bas
In a message to ALL, MONTE FERGUSON wrote:
MF=>  Does anyone  have a nice smooth  color cycler that'll rotate  the VGA
    pallette (for the "tunnel" moving effect)?

MF=>  I've played with writing my own, but this pallette stuff is a pain...
    I was wondering if anyone could save me from re-inventing the wheel.

        A good way  to do it  is to program  your palette into  an array of
long  integers  (for  VGA  palette)  and  use  the PALETTE USING to set the
palette...

DEFINT A-Z
DIM SHARED palar(511) as long
CALL initpal    ' Initialise the 256 colors in the palette (random)
i=0
DO
        palar(i+256)=palar(i)   ' Initialise other colors
        PALETTE USING paral(i)  ' Set palette
        i=i+1 and 511           ' Select next colors in sequence
        CALL delay              ' Delay subroutine to slowdown
LOOP UNTIL LEN(INKEY$)

SUB initpal
FOR i=0 TO 255
        palar(i)=INT(RND*262143!+.5)
NEXT
END SUB

SUB delay
t!=timer
DO:LOOP UNTIL timer-t!=>.1      ' Delay = 1/10 of sec.
END SUB

        Hope it works! I'm working on a hercule card... VGA is at school...
---
 * Origin: INTERACESS Montreal (QC) Canada (514) 528-1415 (1:167/280)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET