home *** CD-ROM | disk | FTP | other *** search
- property sd, spriteNum, pReady, pWorking, pStartTime, pCharging, pDidit, pFirstUpdate, pRechargeTime, pChargeTime, pFrameTimes
- global gGameUpgrades
-
- on beginSprite me
- sd = sprite(spriteNum)
- pReady = 1
- sd.memberNum = 63
- sd.locZ = 150
- pWorking = 0
- pCharging = 0
- pDidit = 0
- sd.visible = 0
- pFirstUpdate = 1
- pRechargeTime = 10
- pChargeTime = 10
- pFrameTimes = [2, 5, 8]
- end
-
- on mouseDown me
- sendSprite(110, #QueueMe, spriteNum, point(sd.locH, sd.locV))
- end
-
- on WhatDoYouWant me
- end
-
- on update me
- if pFirstUpdate then
- pFirstUpdate = 0
- end if
- if pReady then
- if sprite(110).loc = sd.loc then
- pWorking = 1
- pReady = 0
- pDidit = 0
- pStartTime = GetTime()
- end if
- else
- if pWorking then
- if sprite(110).loc = sd.loc then
- if (GetTime() - pStartTime) = pFrameTimes[1] then
- sd.memberNum = 64
- else
- if (GetTime() - pStartTime) = pFrameTimes[2] then
- sd.memberNum = 65
- else
- if (GetTime() - pStartTime) = pFrameTimes[3] then
- sd.memberNum = 66
- if not pDidit then
- playSound(9, "podium")
- StarTheLine()
- pDidit = 1
- end if
- else
- if (GetTime() - pStartTime) = 9 then
- pWorking = 0
- pCharging = 1
- pStartTime = GetTime()
- end if
- end if
- end if
- end if
- else
- pWorking = 0
- pReady = 1
- sd.memberNum = 63
- pDidit = 0
- end if
- else
- if pCharging then
- sd.memberNum = 62
- if (GetTime() - pStartTime) >= pRechargeTime then
- pReady = 1
- pCharging = 0
- sd.memberNum = 63
- pDidit = 0
- end if
- end if
- end if
- end if
- end
-