home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / optimus / agata / home.dir / 00009_2 chan mov.ls < prev    next >
Encoding:
Text File  |  1997-02-20  |  1.0 KB  |  34 lines

  1. property myChan1, myChan2, maxFrames, currFrame, cast1List, x1List, y1List, cast2List, x2List, y2List, cast1Index, cast2Index
  2. global theCoord
  3.  
  4. on birth me, chan1, chan2
  5.   set myChan1 to chan1
  6.   set myChan2 to chan2
  7.   set the stretch of sprite myChan1 to 0
  8.   set the stretch of sprite myChan2 to 0
  9.   return me
  10. end
  11.  
  12. on startAnimation me
  13.   set currFrame to 1
  14. end
  15.  
  16. on Animate me
  17.   if currFrame <= maxFrames then
  18.     set cast1Index to getAt(cast1List, currFrame)
  19.     set cast2Index to getAt(cast2List, currFrame)
  20.     set the locH of sprite myChan1 to getAt(x1List, currFrame)
  21.     set the locV of sprite myChan1 to getAt(y1List, currFrame)
  22.     set the castNum of sprite myChan1 to cast1Index
  23.     set the locH of sprite myChan2 to getAt(x2List, currFrame)
  24.     set the locV of sprite myChan2 to getAt(y2List, currFrame)
  25.     set the castNum of sprite myChan2 to cast2Index
  26.   end if
  27.   if currFrame > maxFrames then
  28.     set the castNum of sprite myChan1 to 0
  29.     set the castNum of sprite myChan2 to 0
  30.     RemoveBOL(theCoord, me)
  31.   end if
  32.   set currFrame to currFrame + 1
  33. end
  34.