home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 334.lha / StripAnim_v1.1 / brush.script next >
Text File  |  1990-01-10  |  2KB  |  56 lines

  1.  
  2. rem  example of use of converted anim brush
  3.  
  4.         load 1,"mach1"  :rem  load background pic
  5.         new 5,1                 :rem  create buffer for
  6.         copy 1,5                :rem  second copy of it
  7.  
  8.         load 10,"sb.anim"       :rem  load first frame of brush anim
  9.         loadanim 11,"sb.anim"   :rem  load anim data from brush anim
  10.  
  11.         new 2,1                 :rem  second buffer to dbl buffer into
  12.         copy -1,2
  13.         buff=2                  :rem  next frame buffer
  14.         blitdest buff           :rem  blit output to next frame buffer
  15.  
  16.         x=0                     :rem  starting x,y position
  17.         y=0
  18.         inc = 3
  19.         xinc=inc                        :rem  starting x and y increments
  20.         yinc=inc
  21.         inc = inc+inc
  22.         resolution 10,width,height,depth
  23.         width=width+inc         :rem  fudge enough to cover 2 previous frames
  24.         height=height+inc
  25.  
  26. 10
  27.         transparent 0
  28.         blit 5,x-inc,y-inc,x-inc,y-inc,width,height  :rem  erase old object
  29.                                 :rem  could do this with a "copy 5,buff"
  30.                                 :rem  except this is faster
  31.         transparent 1
  32.         blit 10,0,0,x,y,-1,-1   :rem  blit new object into position
  33.  
  34.         x=x+xinc                :rem  new x,y location
  35.         y=y+yinc
  36.  
  37.         if x > 263 | x < -38    :rem  check if we bounce off l/r walls
  38.                 xinc = 0-xinc   :rem  yep, reverse direction
  39.                 x=x+xinc+xinc
  40.         endif
  41.  
  42.         if y > 158 | y < -26    :rem  check top and bottom walls
  43.                 yinc = 0-yinc   :rem  yep, reverse direction
  44.                 y=y+yinc+yinc
  45.         endif
  46.  
  47.         display buff            :rem  display new frame
  48.         buff=3-buff             :rem  update next frame buffer variable
  49.         blitdest buff           :rem  output to next frame buffer
  50.         anim 11,10,a,r,d        :rem  generate next frame of brush
  51.                                 :rem  an anim brush is a single buffered
  52.                                 :rem  anim, so only one buffer to anim into
  53.                                 :rem  is required
  54.         goto 10                 :rem  loop forever  (until left mouse abort)
  55.  
  56.