home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 5 / boot-disc-1997-01.iso / media / utility.cst / 00011_Script_BlinkLightClass < prev    next >
Text File  |  1996-11-05  |  1KB  |  37 lines

  1. property interval,spritenum,locast,hicast,ancestor,changetime,halotime
  2.  
  3. on new me,mysprite,myinterval,myhalotime
  4.   set interval=default(1,myinterval)
  5.   set halotime=default(0.5,myhalotime)
  6.   set spritenum=mysprite
  7.   put spritenum
  8.   set mycast=the name of member (the membernum of sprite spritenum)
  9.   puppetsprite spritenum,true
  10.   set locast=the number of member mycast
  11.   set hicast=the number of member (mycast&"1")
  12.   set ancestor=new(script "GenericClass")
  13.   set changetime=the ticks+random(interval*60)
  14.   clearActorlist me,"BlinkLightClass",#spritenum
  15.   add the actorlist,me
  16.   return me
  17. end
  18.  
  19. on stepframe me
  20.   if changetime<the ticks then
  21.     if (the membernum of sprite spritenum)=locast then
  22.       set the membernum of sprite spritenum=hicast
  23.       set changetime=the ticks+random(halotime*60)
  24.     else
  25.       set the membernum of sprite spritenum=locast
  26.       set changetime=the ticks+random(interval*60)
  27.     end if
  28.     updateStage
  29.   end if
  30. end
  31.  
  32. on dispose me
  33.   clearactorlist me,"BlinkLightClass",#spritenum
  34.   return 0
  35. end
  36.  
  37.