DROPPING.BAS

Go back

Below you'll find the source for the QBasic file DROPPING.BAS.

I've been in doubt if I'd republish this file again. Mainly for a few reasons;
1. The stuff I made as a kid is very childish (which kinda makes sense)
2. Times have changed; what was funny/innovative or sharable in 1997 doesn't meet standards in 2024.
3. Most of the code doesn't run natively anymore on modern operating systems.
4. It's in the Dutch language, where most of my shared content is in English.

Still, I've decided to share this file. Keep in mind the age of this content though.

Download DROPPING.BAS for QBasic

'Declareert de functie Kleur
DECLARE FUNCTION Kleur! (blauw!, groen!, rood!)

'Stelt de 'random'in
RANDOMIZE TIMER

'Zet bepaalde functies aan
ON ERROR GOTO fout2
ON KEY(1) GOSUB Einde: KEY(1) ON

'Speciale melding
PRINT "Druk op F1 om de demo te stoppen als de demo bezig is"
SLEEP 2: a$ = INKEY$

'Stelt monitor in
ON ERROR GOTO fout1
SCREEN 13
ON ERROR GOTO fout2

'Past beginpalet aan
FOR a = 0 TO 63:    PALETTE a, Kleur(a, 0, 0):       NEXT a
FOR a = 64 TO 127:  PALETTE a, Kleur(a - 64, 0, 0):  NEXT a
FOR a = 128 TO 190: PALETTE a, Kleur(a - 128, 0, 0): NEXT a
FOR a = 191 TO 254: PALETTE a, Kleur(a - 191, 0, 0): NEXT a

'Tekent beeld
FOR a = 0 TO 320
   FOR b = 0 TO 200
      c = c + 1
      IF c > 255 THEN c = 1
      PSET (a, b), c
   NEXT b
NEXT a
FOR a = 0 TO 255: PALETTE a, 0: NEXT a


'De demo zelf
DO

   FOR a = 0 TO 255: b = INT(RND * 64): PALETTE a, Kleur(0, 0, b): NEXT a
   FOR a = 0 TO 255: b = INT(RND * 64): PALETTE a, Kleur(0, b, 0): NEXT a
   FOR a = 0 TO 255: b = INT(RND * 64): PALETTE a, Kleur(b, 0, 0): NEXT a

   FOR a = 0 TO 255: b = INT(RND * 64): PALETTE a, Kleur(b, b, 0): NEXT a
   FOR a = 0 TO 255: b = INT(RND * 64): PALETTE a, Kleur(b, 0, b): NEXT a
   FOR a = 0 TO 255: b = INT(RND * 64): PALETTE a, Kleur(0, b, b): NEXT a

   FOR a = 0 TO 255: b = INT(RND * 64): PALETTE a, Kleur(b, b, b): NEXT a

LOOP

Einde: 'Terug naar DOS
SCREEN 0: WIDTH 80, 25
PRINT "This demo is made by:"
PRINT , , "Stefan Thoolen"
PRINT , , "-Address removed-"
PRINT , , "48** **  Breda"
PRINT , , "The Netherlands"
SYSTEM

fout1: PRINT "Monitor niet goed genoeg; verwacht VGA (SCREEN 13)": SYSTEM
fout2: PRINT "Onverwachte fout nr."; ERR; "gevonden": SYSTEM

'Berekent een kleur (voor screen 12/13) met de tinten blauw, groen en rood
'Die kun je dan met PALETTE instellen. Bijv. PALETTE 1, KLEUR(63, 63, 63)
'Dan is kleur 1 (COLOR 1) fel wit. De getallen kunnen van 0 tot en met 63
'zijn.
FUNCTION Kleur (blauw, groen, rood)
   Kleur = 65536 * blauw + 256 * groen + rood
END FUNCTION