home *** CD-ROM | disk | FTP | other *** search
- property pMissionObjective, pTimeLimit, pStartTime, pFinalTimer
- global gLevelNum, gBlockArray, gLaserArray, gColorArray, gDirectionArray, gLaserList, gNumBlocks, gLockedArray, gRemaindingTime, gLevelSeconds
-
- on new me
- pFinalTimer = the ticks
- gLevelSeconds = 0
- repeat with superCounter = 15 to 580
- sprite(superCounter).puppet = 0
- end repeat
- gLaserList = []
- put count(gLaserList)
- gNumBlocks = 0
- gLevelNum = gLevelNum + 1
- loadLevelData(gLevelNum)
- diplayCurrentLevel()
- count = 1
- repeat with y = 1 to 8
- repeat with x = 1 to 8
- if gBlockArray[x][y] = 0 then
- sprite(50 + count).puppet = 0
- else
- if gBlockArray[x][y] = 7 then
- if gColorArray[x][y] = 3 then
- append(gLaserList, new(script("LaserScript"), x, y, gDirectionArray[x][y], 1, (count(gLaserList) * 40) + 120))
- append(gLaserList, new(script("LaserScript"), x, y, gDirectionArray[x][y], 2, (count(gLaserList) * 40) + 120))
- append(gLaserList, new(script("LaserScript"), x, y, gDirectionArray[x][y], 4, (count(gLaserList) * 40) + 120))
- else
- append(gLaserList, new(script("LaserScript"), x, y, gDirectionArray[x][y], gColorArray[x][y], (count(gLaserList) * 40) + 120))
- end if
- end if
- gBlockArray[x][y] = new(script("BlockScript"), y, x, gBlockArray[x][y], gColorArray[x][y], gDirectionArray[x][y], gLockedArray[x][y], 50 + count)
- gNumBlocks = gNumBlocks + 1
- end if
- count = count + 1
- end repeat
- end repeat
- repeat with a = 1 to count(gLaserList)
- gLaserList[a].updateLaser()
- end repeat
- pStartTime = the ticks
- end
-
- on exitFrame me
- if pMissionObjective = 0 then
- if (pFinalTimer + 60) < the ticks then
- pFinalTimer = the ticks
- gLevelSeconds = (the ticks - pStartTime) / 60
- gRemaindingTime = pTimeLimit - gLevelSeconds
- displayTime()
- end if
- if gRemaindingTime <= 0 then
- puppetSound(4, "lose")
- go(50)
- exit
- end if
- doMouseInput()
- end if
- if ((keyPressed(SPACE) = 1) or (the mouseDown = 1)) and (sprite(599).visible = 1) then
- pStartTime = the ticks
- pMissionObjective = 0
- sprite(599).visible = 0
- end if
- go(the frame)
- end
-
- on loadLevelData levelNum
- pMissionObjective = 1
- case levelNum of
- 1:
- sprite(599).visible = 1
- sprite(599).member = "Hint1"
- pTimeLimit = 240
- gBlockArray = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [7, 0, 0, 0, 1, 9, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [8, 0, 3, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]
- gColorArray = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [3, 0, 0, 0, 4, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 3, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]
- gDirectionArray = [[1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 2, 2, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 2, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]]
- gLockedArray = [[1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 0, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]]
- 2:
- sprite(599).visible = 1
- sprite(599).member = "Hint2"
- pTimeLimit = 200
- gBlockArray = [[6, 6, 6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6, 6, 6], [1, 6, 6, 6, 6, 6, 6, 6], [1, 6, 6, 6, 9, 6, 7, 6], [1, 6, 6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6, 6, 6], [0, 8, 6, 6, 6, 6, 6, 6], [0, 0, 6, 6, 6, 6, 6, 6]]
- gColorArray = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [3, 0, 0, 0, 0, 0, 0, 0], [3, 0, 0, 0, 3, 0, 3, 0], [3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]
- gDirectionArray = [[1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 2, 1, 4, 1], [2, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 2, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]]
- gLockedArray = [[1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 0, 1, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1], [1, 0, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]]
- 3:
- sprite(599).visible = 1
- sprite(599).member = "Hint3"
- pTimeLimit = 180
- gBlockArray = [[6, 6, 6, 8, 8, 6, 6, 6], [6, 6, 6, 4, 4, 6, 6, 6], [7, 2, 6, 0, 0, 6, 6, 6], [6, 6, 6, 1, 1, 6, 6, 6], [6, 6, 6, 1, 1, 6, 6, 6], [6, 6, 6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6, 2, 1], [7, 6, 6, 9, 9, 6, 6, 8]]
- gColorArray = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 2, 1, 0, 0, 0], [3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 2, 1, 0, 0, 0], [0, 0, 0, 2, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 4], [3, 0, 0, 1, 2, 0, 0, 0]]
- gDirectionArray = [[1, 1, 1, 3, 3, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 2, 2, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 2], [2, 1, 1, 1, 1, 1, 1, 1]]
- gLockedArray = [[1, 1, 1, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 0, 0, 1, 1, 0]]
- 4:
- sprite(599).visible = 1
- sprite(599).member = "Hint4"
- pTimeLimit = 180
- gBlockArray = [[7, 0, 0, 0, 7, 0, 0, 7], [0, 7, 6, 6, 6, 6, 7, 0], [0, 6, 0, 0, 0, 3, 6, 0], [7, 6, 0, 3, 4, 0, 6, 0], [0, 6, 0, 4, 3, 0, 6, 7], [0, 6, 3, 0, 0, 0, 6, 0], [0, 7, 6, 6, 6, 6, 7, 0], [7, 0, 0, 7, 0, 0, 0, 7]]
- gColorArray = [[2, 0, 0, 0, 4, 0, 0, 2], [0, 1, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 3, 0, 0], [4, 0, 0, 3, 1, 0, 0, 0], [0, 0, 0, 4, 3, 0, 0, 4], [0, 0, 3, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 0], [2, 0, 0, 4, 0, 0, 0, 2]]
- gDirectionArray = [[3, 1, 1, 1, 4, 1, 1, 4], [1, 3, 1, 1, 1, 1, 4, 1], [1, 1, 1, 1, 1, 1, 1, 1], [3, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 2, 1, 1, 1, 1, 1, 1], [2, 1, 1, 2, 1, 1, 1, 1]]
- gLockedArray = [[1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0, 1, 1], [1, 0, 1, 1, 1, 0, 0, 1], [1, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 0, 1], [1, 0, 0, 1, 1, 1, 0, 1], [1, 1, 0, 0, 0, 0, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]]
- 5:
- sprite(599).visible = 1
- sprite(599).member = "Hint5"
- pTimeLimit = 180
- gBlockArray = [[0, 6, 6, 6, 6, 6, 6, 6], [0, 6, 1, 1, 1, 1, 1, 1], [0, 6, 1, 1, 1, 1, 3, 1], [0, 6, 1, 1, 1, 1, 1, 1], [7, 6, 1, 1, 1, 1, 3, 1], [7, 6, 1, 1, 1, 1, 1, 1], [7, 6, 1, 1, 1, 1, 3, 1], [0, 6, 6, 6, 6, 6, 6, 6]]
- gColorArray = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 2, 2, 2, 1, 2, 1], [0, 0, 4, 4, 4, 4, 4, 4], [0, 0, 1, 1, 1, 2, 2, 2], [2, 0, 1, 1, 4, 1, 2, 4], [1, 0, 4, 4, 1, 4, 1, 1], [4, 0, 2, 2, 2, 1, 1, 2], [0, 0, 0, 0, 0, 0, 0, 0]]
- gDirectionArray = [[1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]]
- gLockedArray = [[1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0]]
- end case
- pStartTime = the ticks
- gLevelSeconds = 0
- gLevelSeconds = (the ticks - pStartTime) / 60
- gRemaindingTime = pTimeLimit - gLevelSeconds
- displayTime()
- end
-