home *** CD-ROM | disk | FTP | other *** search
/ Knudde EK Editie / CD1.iso / tinus.dxr / Script_6_Stone.ls < prev    next >
Encoding:
Text File  |  2000-02-24  |  1.7 KB  |  65 lines

  1. property MySprite, MyMem, MyType, MyH, MyV, MyStatus, MySpeed
  2. global MyFlip
  3.  
  4. on new me, spr, tList, Side
  5.   MySprite = spr + 20
  6.   MyType = #Stone
  7.   MyMem = getAt(tList, 1)
  8.   if MyMem = 174 then
  9.     sprite(MySprite).locZ = 10
  10.   else
  11.     sprite(MySprite).locZ = 5
  12.   end if
  13.   if Side = #right then
  14.     MyH = (spr * (235 + random(30))) + 640
  15.   else
  16.     if Side = #left then
  17.       MyH = 0 - (spr * (235 + random(30)))
  18.     end if
  19.   end if
  20.   MyV = getAt(tList, 2)
  21.   MyStatus = #normal
  22.   sprite(MySprite).member = member(MyMem, 1)
  23.   sprite(MySprite).loc = point(MyH, MyV)
  24.   sprite(MySprite).flipH = MyFlip
  25.   return me
  26. end
  27.  
  28. on Update me
  29.   global Scrolling, Direction, MaaierSpr, MaaierMem, MaaierStatus, TinusSpr, TinusMem, TinusStatus, TinusOnsterf, GrasSpr
  30.   MyH = MyH + Scrolling
  31.   if MyStatus = #normal then
  32.     if sprite MySprite intersects MaaierSpr and (TinusStatus = #normal) and (TinusOnsterf = 0) then
  33.       puppetSound(1, 108 + random(3))
  34.       TinusMem = 25
  35.       MaaierStatus = #stuk
  36.       TinusStatus = #FrontDrop
  37.       updateStage()
  38.       sprite(MaaierSpr).visible = 0
  39.       sprite(GrasSpr).visible = 0
  40.       MyStatus = #GetOut
  41.       TinusOnsterf = 100
  42.     end if
  43.   end if
  44.   if (MySprite = 50) and (MyH < -60) and (Direction = #right) and (MyStatus = #normal) then
  45.     MyStatus = #OutScreen
  46.     TinusStatus = #OutScreenRight
  47.     Scrolling = 0
  48.   else
  49.     if (MySprite = 50) and (MyH > 700) and (Direction = #left) and (MyStatus = #normal) then
  50.       MyStatus = #OutScreen
  51.       TinusStatus = #OutScreenLeft
  52.       Scrolling = 0
  53.     end if
  54.   end if
  55.   if (MyH < 700) and (MyH > -60) then
  56.     sprite(MySprite).member = member(MyMem, 1)
  57.     sprite(MySprite).loc = point(MyH, MyV)
  58.     sprite(MySprite).flipH = MyFlip
  59.   end if
  60. end
  61.  
  62. on stepFrame me
  63.   Update(me)
  64. end
  65.