home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 4 / AUCD4.iso / acornuser / 1998 / apr1998 / regulars / StarInfo / Stoner / Water (.txt) < prev   
RISC OS BBC BASIC V Source  |  1997-08-18  |  2KB  |  80 lines

  1.  True Plasma Drawer
  2.  by Nigel Stoner 1997
  3. setpal
  4. fullscrn
  5. crosscrn
  6.  "OS_SWINumberFromString",,"ColourTrans_SetGCOL" 
  7.  col%
  8. doit:
  9. " in line ";
  10.  cx%(16),cy%(16),pal%(255)
  11. pickcs
  12.  calculate attractors
  13.  a%=0 
  14.  centre%:cx%(a%)=
  15. (1280):cy%(a%)=
  16. (1280):
  17. setpal
  18.  set pallette
  19.  COLOR a%,a%*(8*SINRAD(TIME)+8) ? for random colors ?
  20.  a%=0 
  21. a%,a%*16,a%*16,a%*16::
  22.  set sin pallette
  23.  a%=0 
  24. !!pal%(a%)=127*
  25. (a%*1.411)+128
  26. fullscrn
  27. &Ccentre%=3:band=
  28. (1)*.5+.1:
  29. (band*100)):over%=8:start%=0
  30. pickcs
  31.  y%= start% 
  32.  1024-over% 
  33.  over%:
  34.  x%= start% 
  35.  1280-over% 
  36.  over%:xsum%=0:ysum%=0:
  37.  a%=0 
  38.  centre%:dx%=cx%(a%)-x%:dy%=cy%(a%)-y%
  39. d2%=dx%*dx% + dy%*dy%:
  40.  d2% <> 0  adj%=(dx%*dy%):x2%=(dx%*adj%)>>7:y2%=(dx%*adj%)>>7:xsum%+=(x2%*cx%(a%))/d2%:ysum%+=(y2%*cy%(a%))/d2% 
  41.  a%=centre%+1
  42.  a%:d%=
  43. (xsum%^2+ysum%^2):tx%=d%*band 
  44.  256:
  45. col%,(tx%<<8)+(tx%<<16)+(tx%<<24),,,&100:
  46. x%,y%,over%:
  47.  x%,y%
  48. crosscrn
  49. centre%=3:over%=8:start%=0
  50. pickcs
  51.  y%= start% 
  52.  1024-over% 
  53.  over%/2:
  54.  x%= start% 
  55.  1280-over% 
  56.  over%:xsum%=0:ysum%=0:
  57.  a%=0 
  58.  centre%:dx%=cx%(a%)-x%:dy%=cy%(a%)-y%
  59. d2%=dx%*dx% + dy%*dy%:
  60.  d2% <> 0  adj%=(dx%*dy%):x2%=(dx%*adj%)>>7:y2%=(dx%*adj%)>>7:xsum%+=(x2%*cx%(a%))/d2%:ysum%+=(y2%*cy%(a%))/d2% 
  61.  a%=centre%+1
  62.  a%:d%=
  63. (xsum%^2+ysum%^2):tx%=d%*band 
  64.  256:
  65. col%,(tx%<<8)+(tx%<<16)+(tx%<<24),,,&100:
  66. 69,x%,y%
  67.  x%:start%=start%
  68. cycle:
  69. cycle
  70. /7.6 
  71. 15:r%=16*
  72. (t%/9+60)+18:g%=16*
  73. (t%/8)+18:b%=15*
  74. (t%/7+120)+18:
  75.  a%=0 
  76. (a%+n%)
  77. 16,a%*r%,a%*g%,a%*b%:
  78. (15-a%+n%)
  79. 16,a%*r%,a%*g%,a%*b%:
  80.