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

  1. property myChan1, myChan2, myChan3, maxFrames, currFrame, cast1List, cast2List, cast3List, x1List, humming
  2.  
  3. on birth me, chan1, chan2, chan3
  4.   set myChan1 to chan1
  5.   set myChan2 to chan2
  6.   set myChan3 to chan3
  7.   set the stretch of sprite myChan1 to 0
  8.   set the stretch of sprite myChan2 to 0
  9.   set the stretch of sprite myChan3 to 0
  10.   set x1List to [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 71, 70, 70, 71, 72, 72, 72, 72, 72]
  11.   set cast1List to [591, 592, 591, 592, 594, 593, 594, 592, 591, 592, 594, 593, 594, 592, 591, 592, 591, 591, 591, 591, 591, 591, 591, 591, 591, 591]
  12.   set cast2List to [595, 596, 595, 595, 596, 596, 596, 595, 595, 596, 596, 596, 596, 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, 595]
  13.   set cast3List to [578, 579, 578, 578, 579, 579, 579, 578, 578, 579, 579, 579, 579, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578]
  14.   set maxFrames to count(cast1List)
  15.   set the locV of sprite myChan1 to 309
  16.   set the locH of sprite myChan2 to 117
  17.   set the locV of sprite myChan2 to 325
  18.   set the locH of sprite myChan3 to 156
  19.   set the locV of sprite myChan3 to 298
  20.   return me
  21. end
  22.  
  23. on startAnimation me
  24.   global theCoord
  25.   set currFrame to 1
  26.   set rand to random(1)
  27.   if (rand = 1) and not humming and not (the inHelp of theCoord) and not (the dontHumWinnie of theCoord) then
  28.     if random(3) = 2 then
  29.       sound playFile 3, "HMwhum.aif"
  30.       set humming to 1
  31.     end if
  32.   end if
  33. end
  34.  
  35. on Animate me
  36.   if currFrame = maxFrames then
  37.     if soundBusy(3) = 0 then
  38.       set humming to 0
  39.     end if
  40.   end if
  41.   if currFrame <= maxFrames then
  42.     set cast1Index to getAt(cast1List, currFrame)
  43.     set cast2Index to getAt(cast2List, currFrame)
  44.     set cast3Index to getAt(cast3List, currFrame)
  45.     set the castNum of sprite myChan1 to cast1Index
  46.     set the locH of sprite myChan1 to getAt(x1List, currFrame)
  47.     set the castNum of sprite myChan2 to cast2Index
  48.     set the castNum of sprite myChan3 to cast3Index
  49.   else
  50.     if humming then
  51.       startAnimation(me)
  52.     else
  53.       set the castNum of sprite myChan1 to 591
  54.       set the castNum of sprite myChan2 to 595
  55.       set the castNum of sprite myChan3 to 578
  56.       RemoveBOL(theCoord, me)
  57.     end if
  58.   end if
  59.   set currFrame to currFrame + 1
  60. end
  61.