home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / procedures / bang_proc.amos / bang_proc.amosSourceCode
AMOS Source Code  |  1991-06-13  |  960b  |  23 lines

  1. Procedure BANG[XCENTRE,YCENTRE,MSIZE,CYCLES,FIRSTCOLOUR,NOCOLS]
  2.    'XCENTRE,YCENTRE: co-ords of explosions centre 
  3.    'MSIZE: diameter in pixels.   CYCLES: no. of individual explosions 
  4.    'NOCOLS: no. of contiguous palette colours available, the first of which is FIRSTCOLOUR
  5.    '
  6.    'e.g. BANG[160,100,20,4,3,3] 
  7.    ' draws a three cycle explosion 20 pixels across at screen co-ordinates 160,100 , using colours 3,4 and 5. 
  8.    '
  9.    DIV=Int(MSIZE/10+1)
  10.    MSIZE=Int(MSIZE/DIV)*DIV
  11.    For R=1 To CYCLES
  12.       For SIZE=1 To MSIZE Step DIV
  13.          If SIZE=1 Then Cls 0
  14.          Boom : Rem replace this line with your own sample instruction if you're using samples.
  15.          For A=1 To 4
  16.             Ink Rnd(NOCOLS-1)+FIRSTCOLOUR
  17.             XPOS=Min(Rnd(SIZE)+XCENTRE-SIZE,Screen Width)
  18.             YPOS=Min(Rnd(SIZE)+YCENTRE-SIZE,Screen Height)
  19.             Bar XPOS,YPOS To Max(XPOS+SIZE,0),Max(YPOS+SIZE,0)
  20.       Next A : Next SIZE
  21.    Next R
  22.    Cls 0
  23. End Proc