home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / optimus / agata / home.dir / 00084_chimney(old).ls < prev    next >
Encoding:
Text File  |  1997-02-20  |  2.9 KB  |  98 lines

  1. property myChan1, myChan2, maxFrames, currFrame, cast1List, cast2List, animating, var
  2.  
  3. on birth me, chan1, chan2
  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 animating to 0
  9.   return me
  10. end
  11.  
  12. on startAnimation me
  13.   set rand to 1
  14.   if rand = 1 then
  15.     set var to 3
  16.     do("var" & var & " me")
  17.   else
  18.     set var to random(2)
  19.     do("var" & var & " me")
  20.   end if
  21.   set currFrame to 1
  22. end
  23.  
  24. on var1 me
  25.   set cast1List to [68, 69, 70, 68, 70, 69, 68, 68, 68, 68, 69, 68, 70, 69, 70, 68, 68, 68, 68, 68, 68]
  26.   set cast2List to [0, 72, 73, 74, 75, 76, 72, 73, 74, 75, 76, 0, 72, 73, 74, 72, 73, 74, 75, 76, 0]
  27.   set maxFrames to 21
  28.   set the locH of sprite myChan1 to 502
  29.   set the locV of sprite myChan1 to 80
  30.   set the locH of sprite myChan2 to 464
  31.   set the locV of sprite myChan2 to 84
  32. end
  33.  
  34. on var2 me
  35.   set cast1List to [68, 69, 71, 69, 67, 69, 68, 68, 68, 68, 68, 68]
  36.   set cast2List to [0, 0, 72, 73, 74, 75, 76, 0, 0, 0, 0, 0]
  37.   set maxFrames to 12
  38.   set the locH of sprite myChan1 to 502
  39.   set the locV of sprite myChan1 to 80
  40.   set the locH of sprite myChan2 to 460
  41.   set the locV of sprite myChan2 to 84
  42. end
  43.  
  44. on var3 me
  45.   set cast1List to [225, 225, 225, 225, 225, 225, 225, 225, 225, 225]
  46.   set cast2List to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  47.   set maxFrames to 10
  48.   set the locH of sprite myChan1 to 497
  49.   set the locV of sprite myChan1 to 52
  50. end
  51.  
  52. on Animate me
  53.   global theCoord
  54.   if animating then
  55.     if currFrame <= maxFrames then
  56.       put currFrame
  57.       if var = 3 then
  58.         set the locH of sprite myChan1 to 497
  59.         set the locV of sprite myChan1 to 52
  60.         set the castNum of sprite myChan1 to 225
  61.       else
  62.         set the locH of sprite myChan1 to 502
  63.         set the locV of sprite myChan1 to 80
  64.         set the locH of sprite myChan2 to 464
  65.         set the locV of sprite myChan2 to 84
  66.         set cast1Index to getAt(cast1List, currFrame)
  67.         set the castNum of sprite myChan1 to cast1Index
  68.       end if
  69.       set cast2Index to getAt(cast2List, currFrame)
  70.       put the castNum of sprite myChan1
  71.       set the castNum of sprite myChan2 to cast2Index
  72.     else
  73.       set the locH of sprite myChan1 to 502
  74.       set the locV of sprite myChan1 to 80
  75.       set the castNum of sprite myChan1 to 68
  76.       set the castNum of sprite myChan2 to 0
  77.       set animating to 0
  78.     end if
  79.     set currFrame to currFrame + 1
  80.   else
  81.     set the locH of sprite myChan1 to 502
  82.     set the locV of sprite myChan1 to 80
  83.     set the castNum of sprite myChan1 to 68
  84.     if random(30) = 1 then
  85.       set animating to 1
  86.       startAnimation(me)
  87.     end if
  88.   end if
  89.   if not (the cursorHidden of theCoord) then
  90.     if ((the mouseCast > 66) and (the mouseCast < 72)) or (the mouseCast = 225) then
  91.       set the locH of sprite myChan1 to 497
  92.       set the locV of sprite myChan1 to 52
  93.       set the castNum of sprite myChan1 to 225
  94.       set the castNum of sprite myChan2 to 0
  95.     end if
  96.   end if
  97. end
  98.