home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / spritegen / MkRotRod (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1992-09-28  |  2.2 KB  |  72 lines

  1.   >MkRotRod
  2.      auxillary library file for "MakeSpGen"
  3.      creates rotating rod, with rod rotating on rod
  4.  *********************************************************************
  5.         These are constants
  6. _Define_Constants
  7.     Y  Usage$ = "[-Start <r>] [-Radius <r>] [-Delta <radians>] [-Colours <rrGGbb:rrGGbb>]"
  8. +  Param$ = "Start,Radius,Delta,Colours"
  9.   Start     = 0.6
  10.   Radius    = 0.3
  11.   Delta     = 2*
  12. !  Colours$  = "ffFFff:ff22bb"
  13.  Col%(1)
  14.  *********************************************************************
  15. "        Parse the command line
  16. _Params(b%)
  17. getr(Start,    b%!0)
  18. getr(Radius,   b%!4)
  19. getr(Delta,    b%!8)
  20. getz(Colours$, b%!12)
  21. _Read_Colours(Colours$, Col%(), 2)
  22.  *********************************************************************
  23. !        The mode has been set
  24. _Define_Palette
  25.  19, &0, 16, &00, &00, &00  :
  26.  palette
  27.  19, &1, 16, &00, &ff, &00
  28.  19, &2, 16, &ee, &00, &00
  29.  19, &3, 16, &ff, &bb, &44
  30.  19, &4, 16, &ee, &ee, &00
  31.  19, &5, 16, &bb, &88, &55
  32.  19, &6, 16, &aa, &44, &bb
  33.  19, &7, 16, &44, &ff, &00
  34.  19, &8, 16, &66, &dd, &ff
  35.  19, &9, 16, &44, &33, &bb
  36.  19, &a, 16, &77, &77, &77
  37.  19, &b, 16, &bb, &ff, &dd
  38.  19, &c, 16, &11, &11, &dd
  39.  19, &d, 16, &ff, &99, &44
  40.  19, &e, 16, &ff, &ff, &ff
  41.  19, &f, 16, &ee, &ee, &ee
  42.  *********************************************************************
  43.      f = (0, 1]
  44. 6.        xc, yc = OS co-ordinates of center
  45. _Draw_Frame(f, xc, yc)
  46.  c, s, r
  47.  "ColourTrans_SetGCOL", Col%(0),,, &100, 0
  48.   c = 
  49. (f*2*
  50.   s = 
  51. (f*2*
  52. line(xc+RMax*c, xc+RMax*s, xc-RMax*c, xc-RMax*s)
  53.  "ColourTrans_SetGCOL", Col%(1),,, &100, 0
  54.   xc += RMax * Start * c
  55.   yc += RMax * Start * s
  56.   c = 
  57. ((1-f)*2*
  58.  + Delta)
  59.   s = 
  60. ((1-f)*2*
  61.  + Delta)
  62.   r = RMax * Radius
  63. line(xc+r*c, xc+r*s, xc-r*c, xc-r*s)
  64. line(x1, y1, x2, y2)
  65.  dx, dy
  66.  dx= -X 
  67.  dy= -Y 
  68.       
  69.  x1+dx, y1+dy
  70.       
  71.  x2-dx, y2-dy
  72.