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

  1. property myChan1, myChan2, maxFrames, currFrame, cast1List, cast2List
  2.  
  3. on birth me, chan1, chan2, x, y
  4.   set myChan1 to chan1
  5.   set myChan2 to chan2
  6.   set the stretch of sprite myChan1 to 0
  7.   set the stretch of sprite myChan2 to 0
  8.   set cast1List to [77, 78, 79, 77, 78, 79, 78, 77, 79, 77, 79, 77, 79, 77, 78, 77, 78, 77, 79, 77, 79, 77, 78, 77, 79, 77, 78, 77]
  9.   set cast2List to [82, 80, 81, 82, 80, 81, 82, 80, 81, 82, 80, 81, 82, 80, 81, 82, 80, 81, 82, 80, 81, 82, 80, 81, 82, 80, 81, 82]
  10.   set maxFrames to 28
  11.   set currFrame to 1
  12.   set the locH of sprite the myChan1 of me to x
  13.   set the locV of sprite the myChan1 of me to y
  14.   set the locH of sprite the myChan2 of me to x
  15.   set the locV of sprite the myChan2 of me to y
  16.   return me
  17. end
  18.  
  19. on Animate me
  20.   if currFrame > maxFrames then
  21.     set currFrame to 1
  22.   end if
  23.   set cast1Index to getAt(cast1List, currFrame)
  24.   set cast2Index to getAt(cast2List, currFrame)
  25.   set the castNum of sprite myChan1 to cast1Index
  26.   set the castNum of sprite myChan2 to cast2Index
  27.   set currFrame to currFrame + 1
  28. end
  29.