home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / rollerrush / game.dcr / Internal_23_podium.ls < prev    next >
Encoding:
Text File  |  2007-10-01  |  1.8 KB  |  81 lines

  1. property sd, spriteNum, pReady, pWorking, pStartTime, pCharging, pDidit, pFirstUpdate, pRechargeTime, pChargeTime, pFrameTimes
  2. global gGameUpgrades
  3.  
  4. on beginSprite me
  5.   sd = sprite(spriteNum)
  6.   pReady = 1
  7.   sd.memberNum = 63
  8.   sd.locZ = 150
  9.   pWorking = 0
  10.   pCharging = 0
  11.   pDidit = 0
  12.   sd.visible = 0
  13.   pFirstUpdate = 1
  14.   pRechargeTime = 10
  15.   pChargeTime = 10
  16.   pFrameTimes = [2, 5, 8]
  17. end
  18.  
  19. on mouseDown me
  20.   sendSprite(110, #QueueMe, spriteNum, point(sd.locH, sd.locV))
  21. end
  22.  
  23. on WhatDoYouWant me
  24. end
  25.  
  26. on update me
  27.   if pFirstUpdate then
  28.     pFirstUpdate = 0
  29.   end if
  30.   if pReady then
  31.     if sprite(110).loc = sd.loc then
  32.       pWorking = 1
  33.       pReady = 0
  34.       pDidit = 0
  35.       pStartTime = GetTime()
  36.     end if
  37.   else
  38.     if pWorking then
  39.       if sprite(110).loc = sd.loc then
  40.         if (GetTime() - pStartTime) = pFrameTimes[1] then
  41.           sd.memberNum = 64
  42.         else
  43.           if (GetTime() - pStartTime) = pFrameTimes[2] then
  44.             sd.memberNum = 65
  45.           else
  46.             if (GetTime() - pStartTime) = pFrameTimes[3] then
  47.               sd.memberNum = 66
  48.               if not pDidit then
  49.                 playSound(9, "podium")
  50.                 StarTheLine()
  51.                 pDidit = 1
  52.               end if
  53.             else
  54.               if (GetTime() - pStartTime) = 9 then
  55.                 pWorking = 0
  56.                 pCharging = 1
  57.                 pStartTime = GetTime()
  58.               end if
  59.             end if
  60.           end if
  61.         end if
  62.       else
  63.         pWorking = 0
  64.         pReady = 1
  65.         sd.memberNum = 63
  66.         pDidit = 0
  67.       end if
  68.     else
  69.       if pCharging then
  70.         sd.memberNum = 62
  71.         if (GetTime() - pStartTime) >= pRechargeTime then
  72.           pReady = 1
  73.           pCharging = 0
  74.           sd.memberNum = 63
  75.           pDidit = 0
  76.         end if
  77.       end if
  78.     end if
  79.   end if
  80. end
  81.