Advertisement
LBASIC

ALRMBOBS.BAS

Jun 5th, 2023
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 1.13 KB | Software | 0 0
  1. '_|_|_|   ALRMBOBS.BAS
  2. '_|_|_|   This program builds on the shadebob concept to create
  3. '_|_|_|   a faster display utilizing the graphics GET and PUT,
  4. '_|_|_|   manipulating screen data directly in an array buffer.
  5. '_|_|_|   No guarantees or warrantees are given or implied.
  6. '_|_|_|   Released to   PUBLIC DOMAIN   by Kurt Kuzba.  (3/10/96)
  7. DECLARE SUB DRAW.bob (x%, y%, i%)
  8. RANDOMIZE TIMER
  9. SCREEN 13: CLS
  10. DIM SHARED buf(805) AS INTEGER
  11. DIM bob(448) AS INTEGER
  12. FOR t% = 0 TO 447: bob(t%) = t%: NEXT
  13. whatbob = 0
  14. DO UNTIL INKEY$ <> ""
  15.    IF whatbob = 0 THEN
  16.       FOR t% = 0 TO 447
  17.          SOUND 1000 + t%, .03
  18.          SWAP bob(t%), bob(RND * 447)
  19.          SOUND 1400 - t%, .03
  20.       NEXT
  21.       i% = RND * 15 + 1
  22.    END IF
  23.    DRAW.bob ((bob(whatbob) \ 16) * 10), ((bob(whatbob) MOD 16) * 10), i%
  24.    whatbob = (whatbob + 1) MOD 448
  25. LOOP
  26. SCREEN 0: : WIDTH 80, 25
  27. '_|_|_|   end  ALRMBOBS.BAS
  28.  
  29. SUB DRAW.bob (x%, y%, i%)
  30.    GET (x%, y%)-(x% + 39, y% + 39), buf
  31.    DEF SEG = VARSEG(buf(0)): os& = VARPTR(buf(0))
  32.    FOR t% = 4 TO 1603
  33.       POKE t% + os&, (PEEK(t% + os&) + i%) AND 255
  34.    NEXT
  35.    PUT (x%, y%), buf, PSET
  36. END SUB
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement