if (random(250) = 1) and ((gCurrentLevel = 2) or (gCurrentLevel = 3)) then
pLaserDoors = 1
end if
if (pFixing = 1) and (pDying = 0) then
doFixingAnimation()
end if
if sprite(8).blend >= 90 then
if not (pEneObject = 0) then
if (sprite(11).intersects(pEneObject.getEnemyChannel()) = 1) or (sprite(11).intersects(pEneObject2.getEnemyChannel()) = 1) then
if pDying = 0 then
sprite(8).member = "alienhit"
puppetSound(1, "player hit")
sprite(8).locZ = 8
pDying = 1
pPhase = 1
end if
end if
end if
if not (pEneObject3 = 0) then
if sprite(11).intersects(pEneObject3.getEnemyChannel()) then
if pDying = 0 then
sprite(8).member = "alienhit"
puppetSound(1, "player hit")
sprite(8).locZ = 8
pDying = 1
pPhase = 1
end if
end if
end if
if not (pEneObject4 = 0) then
if sprite(11).intersects(pEneObject4.getEnemyChannel()) then
if pDying = 0 then
sprite(8).member = "alienhit"
puppetSound(1, "player hit")
sprite(8).locZ = 8
pDying = 1
pPhase = 1
end if
end if
end if
if not (pEneObject5 = 0) then
if sprite(11).intersects(pEneObject5.getEnemyChannel()) then
if pDying = 0 then
sprite(8).member = "alienhit"
puppetSound(1, "player hit")
sprite(8).locZ = 8
pDying = 1
pPhase = 1
end if
end if
end if
if sprite(11).intersects(17) then
if pDying = 0 then
sprite(8).member = "alienhit2"
puppetSound(1, "player hit")
pDying = 1
pPhase = 2
end if
end if
end if
if pDying = 1 then
doDyingAnimation()
end if
if pLaserDoors = 1 then
if not ((pDying = 1) and (pPhase2 = 4)) then
doDoorAnimation()
end if
end if
if not ((pDying = 1) and (pPhase2 = 4)) then
doDamagedSpriteEffect(pTheDamagedSprite)
end if
if (pDying = 0) and (pFixing = 0) then
checkInput()
end if
if not ((pDying = 1) and (pPhase2 = 4)) then
if not (pEneObject = 0) then
pEneObject.moveEnemy()
end if
if not (pEneObject2 = 0) then
pEneObject2.moveEnemy()
end if
if not (pEneObject3 = 0) then
pEneObject3.moveEnemy()
end if
if not (pEneObject4 = 0) then
pEneObject4.moveEnemy()
end if
if not (pEneObject5 = 0) then
pEneObject5.moveEnemy()
end if
end if
go(the frame)
end
on checkInput
antDirection = pAntObject.getAntDirection()
if keyPressed(126) and keyPressed(123) then
if antDirection = 5 then
pAntObject.moveAnt()
else
pAntObject.setAntDirection(5)
end if
else
if keyPressed(126) and keyPressed(124) then
if antDirection = 6 then
pAntObject.moveAnt()
else
pAntObject.setAntDirection(6)
end if
else
if keyPressed(125) and keyPressed(123) then
if antDirection = 7 then
pAntObject.moveAnt()
else
pAntObject.setAntDirection(7)
end if
else
if keyPressed(125) and keyPressed(124) then
if antDirection = 8 then
pAntObject.moveAnt()
else
pAntObject.setAntDirection(8)
end if
else
if keyPressed(123) then
if antDirection = 4 then
pAntObject.moveAnt()
else
pAntObject.setAntDirection(4)
end if
else
if keyPressed(124) then
if antDirection = 2 then
pAntObject.moveAnt()
else
pAntObject.setAntDirection(2)
end if
else
if keyPressed(126) then
if antDirection = 1 then
pAntObject.moveAnt()
else
pAntObject.setAntDirection(1)
end if
else
if keyPressed(125) then
if antDirection = 3 then
pAntObject.moveAnt()
else
pAntObject.setAntDirection(3)
end if
end if
end if
end if
end if
end if
end if
end if
end if
if keyPressed(SPACE) then
if (pAntObject.getAntPositionX() < (sprite(98).locH + 20)) and (pAntObject.getAntPositionX() > (sprite(98).locH - 20)) and (pAntObject.getAntPositionY() < (sprite(98).locV + 20)) and (pAntObject.getAntPositionY() > (sprite(98).locV - 20)) then
puppetSound(1, "electric_fixing")
pFixing = 1
sprite(8).member = "fixing_up_1"
if (pTheDamagedSprite = 100) or (pTheDamagedSprite = 102) then
sprite(8).member = "fixing_right_1"
end if
if (pTheDamagedSprite = 101) or (pTheDamagedSprite = 107) then
if ((pEneObject.getEnemyPositionX() > (290 + 130)) or (pEneObject.getEnemyPositionX() < (290 - 20))) and ((pEneObject2.getEnemyPositionX() > (290 + 20)) or (pEneObject2.getEnemyPositionX() < (290 - 120))) then
pPhase1 = 2
sprite(17).loc = point(289, 41)
sprite(17).height = 1
end if
else
sprite(3).locH = sprite(3).locH - 1
sprite(2).locH = sprite(2).locH + 1
end if
else
if pPhase1 = 2 then
puppetSound(3, "particleblaster")
sprite(17).height = sprite(17).height + 50
if sprite(17).height >= 334 then
sprite(17).height = 334
pPhase1 = 3
end if
else
if pPhase1 = 3 then
if not (((pEneObject.getEnemyPositionX() > (290 + 150)) or (pEneObject.getEnemyPositionX() < (290 - 20))) and ((pEneObject2.getEnemyPositionX() > (290 + 20)) or (pEneObject2.getEnemyPositionX() < (290 - 120)))) then
pPhase1 = 4
end if
if sprite(17).blend = 100 then
sprite(17).blend = 50
else
sprite(17).blend = 100
end if
eCounter = eCounter + 1
if eCounter > 500 then
eCounter = 0
pPhase1 = 4
end if
else
if pPhase1 = 4 then
if sprite(17).blend = 100 then
sprite(17).blend = 50
else
sprite(17).blend = 100
end if
sprite(17).height = sprite(17).height - 20
if sprite(17).height <= 0 then
sprite(17).height = 1
pPhase1 = 5
end if
else
if pPhase1 = 5 then
sprite(3).locH = sprite(3).locH + 1
sprite(2).locH = sprite(2).locH - 1
if (sprite(2).locH - sprite(3).locH) < 30 then
pPhase1 = 1
pLaserDoors = 0
end if
end if
end if
end if
end if
end if
end
on doDyingAnimation
if pPhase2 = 1 then
fcounter = fcounter + 1
if fcounter > 35 then
fcounter = 0
pPhase2 = 3
end if
else
if pPhase2 = 2 then
fcounter = fcounter + 1
if fcounter > 35 then
fcounter = 0
pPhase2 = 3
end if
else
if pPhase2 = 3 then
sprite(8).blend = sprite(8).blend - 5
if sprite(8).blend < 10 then
sprite(8).blend = 1
gNumLives = gNumLives - 1
displayTries()
pPhase2 = 4
if gNumLives < 0 then
gNumLives = 0
displayTries()
member("WinOrLoose1").text = "Better Luck" & RETURN & " Next Time"
member("WinOrLoose2").text = "Better Luck" & RETURN & " Next Time"