Advertisement
LBASIC

ALEXSAVE.BAS

Jun 5th, 2023
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 2.39 KB | Source Code | 0 0
  1. 'From: Alex Wellerstein          Conference: FidoQBasic   (139)
  2. 'Date: 06-09-96 12:48               Subject: This is AMAZING i think  
  3. 'this is a little screensaver type thingy i made... when there are a lot
  4. 'of lines, it looks real trippy... if it's real slow (especially in
  5. 'QBasic v.1.1) make sure to adjust the delay variable to like 0 or
  6. 'something...
  7. 'COOLSAVE.BAS  by Alex Wellerstein (General Electrik)
  8. DEFINT A-Z: SCREEN 13: CLS : s = 10: c = 32: delay = 2
  9. RANDOMIZE (TIMER * 1000)
  10. WHILE k$ <> CHR$(27)
  11.    REDIM x(s) AS INTEGER, y(s) AS INTEGER, xd(s) AS INTEGER
  12.    REDIM yd(s) AS INTEGER, xs(s) AS INTEGER, ys(s) AS INTEGER
  13.    FOR i = 1 TO s
  14.       x(i) = RND * 320: y(i) = RND * 200
  15.       xd(i) = RND * 2: yd(i) = RND * 2
  16.       xs(i) = RND * 5: ys(i) = RND * 5
  17.    NEXT
  18.    DO
  19.       FOR i = 1 TO s - 1
  20.          LINE (x(i), y(i))-(x(i + 1), y(i + 1)), 0
  21.       NEXT: LINE (x(s), y(s))-(x(1), y(1)), 0
  22.       FOR i = 1 TO s
  23.          IF x(i) > 320 THEN xd(i) = 0: xs(i) = RND * 5
  24.          IF x(i) < 1 THEN xd(i) = -1: xs(i) = RND * 5
  25.          IF y(i) > 200 THEN yd(i) = 0: ys(i) = RND * 5
  26.          IF y(i) < 1 THEN yd(i) = -1: ys(i) = RND * 5
  27.          IF yd(i) THEN y(i) = y(i) + ys(i) ELSE y(i) = y(i) - ys(i)
  28.          IF xd(i) THEN x(i) = x(i) + xs(i) ELSE x(i) = x(i) - xs(i)
  29.       NEXT: c = (c + 1) AND 127: IF c = 0 THEN c = rand * 90 + 32
  30.       FOR i = 1 TO s - 1
  31.          LINE (x(i), y(i))-(x(i + 1), y(i + 1)), c
  32.       NEXT: LINE (x(s), y(s))-(x(1), y(1)), c: k$ = INKEY$
  33.       FOR D = 0 TO delay: WAIT &H3DA, 8: WAIT &H3DA, 8, 8: NEXT
  34.       SELECT CASE k$
  35.          CASE CHR$(0) + CHR$(72): IF s < 30 THEN s = s + 1: EXIT DO
  36.          CASE CHR$(0) + CHR$(80): IF s > 3 THEN s = s - 1: EXIT DO
  37.          CASE CHR$(0) + CHR$(75): delay = delay + (delay >= 0)
  38.          CASE CHR$(0) + CHR$(77): delay = delay - (delay <= 4)
  39.          CASE " ": GOSUB Spaced
  40.          CASE CHR$(27): EXIT DO
  41.       END SELECT
  42.    LOOP
  43. WEND: SCREEN 0: WIDTH 80, 25: END
  44. Spaced:
  45.    CLS : LOCATE 5
  46.    M$ = "Alex's Screen Saver": GOSUB Center
  47.    M$ = "ESC quits": GOSUB Center
  48.    M$ = "Left Arrow = Slower": GOSUB Center
  49.    M$ = "Right Arrow = faster": GOSUB Center
  50.    M$ = "Down Arrow = More Lines": GOSUB Center
  51.    M$ = "Up Arrow = Fewer Lines": GOSUB Center
  52.    SLEEP 3: WHILE INKEY$ <> "": WEND: RETURN
  53. Center:
  54.    M$ = SPACE$(20 - ((LEN(M$) + 1) \ 2)) + M$
  55.    PRINT : PRINT M$: RETURN
  56. 'if ya dig it, tell me!
  57.  
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement