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

  1. global MaaierStatus, Scrolling, MyFlip, MyBottom, TinusXtraMem, TinusStatus, TinusLife, TinusOnsterf, TinusSpr, TinusMem, TinusH, TinusV, TinusFlikker, MaaierSpr
  2.  
  3. on initTinus
  4.   TinusSpr = 10
  5.   TinusMem = 8
  6.   TinusXtraMem = 0
  7.   TinusStatus = #Startright
  8.   TinusH = -220
  9.   TinusV = MyBottom
  10.   TinusLife = 3
  11.   TinusFlikker = 10
  12.   TinusOnsterf = 0
  13.   sprite(TinusSpr).visible = 1
  14. end
  15.  
  16. on ControlTinus
  17.   global Direction
  18.   if TinusOnsterf > 0 then
  19.     TinusOnsterf = TinusOnsterf - 1
  20.   else
  21.     TinusOnsterf = 0
  22.   end if
  23.   case TinusStatus of
  24.     #Startright:
  25.       if the timer > 10 then
  26.         TinusXtraMem = 0
  27.       end if
  28.       if TinusH < 220 then
  29.         Scrolling = 0
  30.         TinusH = TinusH + 10
  31.         DoTinus()
  32.       else
  33.         TinusH = 220
  34.         TinusStatus = #normal
  35.       end if
  36.     #StartLeft:
  37.       if the timer > 10 then
  38.         TinusXtraMem = 0
  39.       end if
  40.       if TinusH > 420 then
  41.         Scrolling = 0
  42.         TinusH = TinusH - 10
  43.         DoTinus()
  44.       else
  45.         TinusH = 420
  46.         TinusStatus = #normal
  47.       end if
  48.     #BackDrop:
  49.       if TinusMem >= 48 then
  50.         TinusMem = 49
  51.         TinusStatus = #BackDead
  52.       else
  53.         TinusMem = TinusMem + 0.69999999999999996
  54.       end if
  55.       Scrolling = 0
  56.       sprite(TinusSpr).loc = point(TinusH, TinusV)
  57.       sprite(TinusSpr).memberNum = TinusMem
  58.       sprite(TinusSpr).flipH = MyFlip
  59.     #FrontDrop:
  60.       if TinusMem >= 30 then
  61.         TinusMem = 51
  62.         TinusStatus = #FrontDead
  63.       else
  64.         TinusMem = TinusMem + 0.5
  65.       end if
  66.       Scrolling = 0
  67.       sprite(TinusSpr).loc = sprite(MaaierSpr).loc
  68.       sprite(TinusSpr).memberNum = TinusMem
  69.       sprite(TinusSpr).flipH = MyFlip
  70.     #BackDead:
  71.       if TinusFlikker > 0 then
  72.         if TinusMem >= 50 then
  73.           TinusMem = 49
  74.           TinusFlikker = TinusFlikker - 1
  75.         else
  76.           TinusMem = TinusMem + 0.5
  77.         end if
  78.         sprite(TinusSpr).memberNum = TinusMem
  79.         sprite(TinusSpr).flipH = MyFlip
  80.         updateStage()
  81.       else
  82.         reset()
  83.         TinusFlikker = 10
  84.       end if
  85.     #FrontDead:
  86.       if TinusFlikker > 0 then
  87.         if TinusMem >= 52 then
  88.           TinusMem = 51
  89.           TinusFlikker = TinusFlikker - 1
  90.         else
  91.           TinusMem = TinusMem + 0.5
  92.         end if
  93.         sprite(TinusSpr).memberNum = TinusMem
  94.         sprite(TinusSpr).flipH = MyFlip
  95.         updateStage()
  96.       else
  97.         reset()
  98.         TinusFlikker = 10
  99.       end if
  100.     #OutScreenRight:
  101.       if the timer > 10 then
  102.         TinusXtraMem = 0
  103.       end if
  104.       if TinusH > 900 then
  105.         sprite(20).member = member(117, 1)
  106.         sprite(20).visible = 1
  107.         updateStage()
  108.         startTimer()
  109.         repeat while the timer < 60
  110.         end repeat
  111.         sprite(20).visible = 0
  112.         initBackGound(#left)
  113.         Direction = #left
  114.         MyFlip = 1
  115.         TinusStatus = #StartLeft
  116.       else
  117.         TinusH = TinusH + 10
  118.         DoTinus()
  119.       end if
  120.     #OutScreenLeft:
  121.       if the timer > 10 then
  122.         TinusXtraMem = 0
  123.       end if
  124.       if TinusH < -300 then
  125.         sprite(19).visible = 1
  126.         repeat with n = 1 to 80
  127.           sprite(19).member = member(120 + (n / 8.0), 1)
  128.           updateStage()
  129.         end repeat
  130.         repeat with n = 80 down to 1
  131.           sprite(19).member = member(120 + (n / 8.0), 1)
  132.           updateStage()
  133.         end repeat
  134.         startTimer()
  135.         repeat while the timer < 60
  136.         end repeat
  137.         go(4)
  138.       else
  139.         TinusH = TinusH - 10
  140.         DoTinus()
  141.       end if
  142.     #normal:
  143.       case Direction of
  144.         #right:
  145.           MyFlip = 0
  146.           TinusH = 220
  147.           if bgOneKey(39) = 1 then
  148.             Scrolling = -10
  149.           else
  150.             if bgOneKey(37) = 1 then
  151.               Scrolling = -3
  152.             else
  153.               if (bgOneKey(37) = 0) and (bgOneKey(39) = 0) then
  154.                 Scrolling = -5
  155.               end if
  156.             end if
  157.           end if
  158.         #left:
  159.           MyFlip = 1
  160.           TinusH = 420
  161.           if bgOneKey(39) = 1 then
  162.             Scrolling = 3
  163.           else
  164.             if bgOneKey(37) = 1 then
  165.               Scrolling = 10
  166.             else
  167.               if (bgOneKey(37) = 0) and (bgOneKey(39) = 0) then
  168.                 Scrolling = 5
  169.               end if
  170.             end if
  171.           end if
  172.       end case
  173.       if bgOneKey(38) = 1 then
  174.         TinusXtraMem = 0
  175.         MaaierStatus = #jump
  176.       else
  177.         if (bgOneKey(40) = 1) and (MaaierStatus = #normal) then
  178.           TinusXtraMem = 12
  179.         else
  180.           TinusXtraMem = 0
  181.         end if
  182.       end if
  183.       DoTinus()
  184.   end case
  185. end
  186.  
  187. on DoTinus
  188.   if TinusMem >= 6 then
  189.     TinusMem = 1
  190.   else
  191.     TinusMem = TinusMem + 0.5
  192.   end if
  193.   sprite(TinusSpr).loc = point(TinusH, TinusV)
  194.   sprite(TinusSpr).memberNum = TinusMem + TinusXtraMem
  195.   sprite(TinusSpr).flipH = MyFlip
  196. end
  197.