home *** CD-ROM | disk | FTP | other *** search
- on initializeConstants
- global dropEffectSO, dropFrames, maximumDrops, beamEffectSO, beamFrames, maximumBeams, cloudEffectSO, cloudFrames, maximumClouds
- dropEffectSO = 100
- dropFrames = 6
- maximumDrops = 30
- beamEffectSO = 30
- beamFrames = 6
- maximumBeams = 0
- cloudEffectSO = 30
- cloudFrames = 6
- maximumClouds = 70
- end
-
- on initializeDrops
- global dropEffectSO, dropData, dropFrames, maximumDrops
- dropData = []
- repeat with wDrop = 1 to maximumDrops
- wSprite = wDrop + dropEffectSO
- set the loc of sprite wSprite to point(-50, -50)
- add(dropData, [0, point(0, 0), 0, 0, 0, 0, 0])
- end repeat
- end
-
- on addDrop addLoc, addheight, addGrav
- global dropEffectSO, dropData
- validSlot = 0
- repeat with wScan = 1 to count(dropData)
- if (validSlot = 0) and (dropData[wScan][1] = 0) then
- validSlot = wScan
- end if
- end repeat
- spreadTime = 0
- repeat while addLoc[2] < 280
- addLoc[2] = addLoc[2] + 10
- addheight = addheight - 10
- spreadTime = 1
- end repeat
- if validSlot <> 0 then
- wSprite = dropEffectSO + validSlot
- dropData[validSlot] = [1, addLoc, addheight, addGrav, random(180) + 90, random(75) / 10.0, 0, #Na]
- set the blend of sprite wSprite to 100
- set the loc of sprite wSprite to addLoc
- end if
- end
-
- on moveBaloon
- global throwState, throwDist, startLoc, TargetLoc, monsterData, monsterhitRange, playerScore, idleLoc
- if throwDist >= 12 then
- throwState = 0
- throwDist = 0
- repeat with whichDrop = 1 to 15
- addDrop(TargetLoc + point(0, 25), -25, 0 - (random(350) / 10.0))
- end repeat
- playSound("Splash", 1)
- end if
- if throwState = 0 then
- repeat with whichMonster = 1 to count(monsterData)
- bPoint = TargetLoc
- if bPoint <> VOID then
- if monsterData[whichMonster][1] = 1 then
- if monsterData[whichMonster][2] = 2 then
- mRect = monsterhitRange[whichMonster]
- if inside(bPoint, mRect) = 1 then
- monsterData[whichMonster][2] = 4
- TargetLoc = VOID
- playerScore[monsterData[whichMonster][5]] = playerScore[monsterData[whichMonster][5]] + 1
- integerScore = (playerScore[1] * 30) + (playerScore[2] * 50) - (playerScore[3] * 20)
- if integerScore <= 0 then
- integerScore = 0
- end if
- member("Level Score").text = string(integerScore)
- playSound("Hit enemy " & string(random(3)), 2)
- end if
- end if
- end if
- end if
- end repeat
- TargetLoc = VOID
- idleLoc = point(290, 420) + point((the mouseH - 290) / 3, (the mouseV - 100) / 12)
- set the loc of sprite 131 to idleLoc
- set the width of sprite 131 to 100
- set the height of sprite 131 to 85
- else
- dAim = throwDist * 15
- locX = sin(dAim * PI / 180) * 125
- throwDist = throwDist + 1
- locMod = (startLoc - TargetLoc) / 12.0
- newloc = startLoc - (locMod * throwDist) - point(0, locX)
- modSize = 99 / 15.0
- realSize = modSize * (15 - throwDist)
- set the loc of sprite 131 to newloc
- set the width of sprite 131 to realSize
- set the height of sprite 131 to realSize
- end if
- end
-
- on moveDrops
- global dropEffectSO, dropData, dropFrames
- warpSides = 0
- splashLocList = []
- repeat with wDrop = 1 to 30
- wSprite = wDrop + dropEffectSO
- dAim = dropData[wDrop][5]
- dSpeed = dropData[wDrop][6]
- if dropData[wDrop][1] = 1 then
- locY = cos(dAim * PI / 180) * -dSpeed / 3.0
- locX = sin(dAim * PI / 180) * dSpeed
- movePoint = point(locX, locY)
- dropData[wDrop][2] = dropData[wDrop][2] + movePoint
- if warpSides = 1 then
- if dropData[wDrop][2][1] > 580 then
- dropData[wDrop][2][1] = dropData[wDrop][2][1] - 580
- end if
- if dropData[wDrop][2][1] < 0 then
- dropData[wDrop][2][1] = dropData[wDrop][2][1] + 580
- end if
- if dropData[wDrop][2][2] > 440 then
- dropData[wDrop][2][2] = dropData[wDrop][2][2] - 440
- end if
- if dropData[wDrop][2][2] < 0 then
- dropData[wDrop][2][2] = dropData[wDrop][2][2] + 440
- end if
- end if
- dropData[wDrop][4] = dropData[wDrop][4] + 2.0
- dropData[wDrop][3] = dropData[wDrop][3] + dropData[wDrop][4]
- dLoc = dropData[wDrop][2] + point(0, dropData[wDrop][3])
- if dropData[wDrop][3] > 0 then
- if (dropData[wDrop][3] > 4) and (random(2) = 1) then
- add(splashLocList, dLoc)
- end if
- dropData[wDrop][1] = 0
- set the loc of sprite wSprite to point(-50, -50)
- addCloud(dLoc, 1 + (random(4) / 10.0))
- next repeat
- end if
- if dropData[wDrop][8] = #Na then
- sprite(wSprite).rotation = 0
- else
- newRotate = findAngle(dLoc, dropData[wDrop][8])
- sprite(wSprite).rotation = newRotate
- end if
- dropData[wDrop][8] = dLoc
- set the loc of sprite wSprite to dLoc
- sprite(wSprite).locZ = dropData[wDrop][2][2]
- end if
- end repeat
- repeat with whichSplash = 1 to count(splashLocList)
- end repeat
- end
-
- on initializeBeams
- global beamEffectSO, beamData, beamFrames
- beamData = []
- repeat with wBeam = 1 to 30
- wSprite = wBeam + beamEffectSO
- add(beamData, [0, 0])
- end repeat
- end
-
- on moveBeams
- global beamEffectSO, beamData, beamFrames
- repeat with wBeam = 1 to 30
- if beamData[wBeam][1] = 1 then
- end if
- end repeat
- end
-
- on initializeClouds
- global cloudEffectSO, cloudData, cloudFrames, maximumClouds
- cloudData = []
- repeat with wCloud = 1 to maximumClouds
- wSprite = wCloud + cloudEffectSO
- add(cloudData, [0, 0, 0, point(0, 0)])
- end repeat
- end
-
- on addCloud addLoc, addScale
- global cloudEffectSO, cloudData, cloudFrames
- validSlot = 0
- repeat with wScan = 1 to count(cloudData)
- if (validSlot = 0) and (cloudData[wScan][1] = 0) then
- validSlot = wScan
- end if
- end repeat
- if validSlot <> 0 then
- wSprite = cloudEffectSO + validSlot
- cloudData[validSlot] = [1, -40, addScale, addLoc]
- baseSize = (15 + (1 * cloudData[validSlot][2])) * cloudData[validSlot][3]
- set the width of sprite wSprite to baseSize
- set the height of sprite wSprite to baseSize / 3
- set the blend of sprite wSprite to 100
- set the loc of sprite wSprite to addLoc
- sprite(wSprite).locZ = addLoc[2] - integer(baseSize / 3)
- end if
- end
-
- on moveClouds
- global cloudEffectSO, cloudData, cloudFrames
- repeat with wCloud = 1 to count(cloudData)
- wSprite = cloudEffectSO + wCloud
- if cloudData[wCloud][1] = 1 then
- cloudData[wCloud][2] = cloudData[wCloud][2] + 1
- if cloudData[wCloud][2] > 10 then
- cloudData[wCloud] = [0, 0, 0, point(0, 0)]
- set the loc of sprite wSprite to point(-50, -50)
- end if
- end if
- if cloudData[wCloud][1] = 1 then
- timeC = cloudData[wCloud][2]
- if timeC < 1 then
- timeC = 1
- end if
- baseSize = 75 - ((15 + (2 * timeC)) * cloudData[wCloud][3] * 2)
- set the width of sprite wSprite to baseSize
- set the height of sprite wSprite to baseSize / 2
- set the blend of sprite wSprite to 100
- end if
- end repeat
- end
-
- on applyMonsters
- global monsterData, spawnDelay
- spawnDelay = spawnDelay + 1
- if spawnDelay > 60 then
- spawnDelay = random(40)
- validSlotList = []
- repeat with whichSlot = 1 to count(monsterData)
- if monsterData[whichSlot][1] = 0 then
- add(validSlotList, whichSlot)
- end if
- end repeat
- repeat with whichMon = 1 to random(3)
- if count(validSlotList) > 0 then
- rPick = random(count(validSlotList))
- pickedSlot = validSlotList[rPick]
- monsterData[pickedSlot] = [1, 1, -75, point(0, 0), random(3), 0]
- deleteAt(validSlotList, rPick)
- end if
- end repeat
- end if
- end
-
- on moveMonsters
- global monsterData, monasterInitialLocs, totalValidTargets, whichLevel
- monsterSO = 10
- repeat with wMonster = 1 to 12
- wSprite = monsterSO + wMonster
- appendation = ["A", "A", "A", "A", "B", "B", "B", "C", "C", "C", "C", "C", "C"][wMonster]
- if monsterData[wMonster][1] = 1 then
- case monsterData[wMonster][2] of
- 1:
- maxheight = 0
- if monsterData[wMonster][3] < maxheight then
- monsterData[wMonster][3] = monsterData[wMonster][3] + 12
- end if
- if monsterData[wMonster][3] >= maxheight then
- monsterData[wMonster][2] = 2
- monsterData[wMonster][3] = maxheight
- if random(10) = 1 then
- monsterData[wMonster][6] = 3
- else
- monsterData[wMonster][6] = 60 + [60, 45, 30, 15, 0][whichLevel]
- if monsterData[wMonster][5] <> 3 then
- totalValidTargets = totalValidTargets + 1
- else
- end if
- end if
- end if
- set the loc of sprite wSprite to monasterInitialLocs[wMonster] + point(0, 0 - monsterData[wMonster][3])
- set the member of sprite wSprite to "Target " & string(monsterData[wMonster][5]) & string(appendation)
- 2:
- monsterData[wMonster][6] = monsterData[wMonster][6] - 1
- if monsterData[wMonster][6] <= 0 then
- monsterData[wMonster][2] = 3
- end if
- 3:
- if monsterData[wMonster][3] > -175 then
- monsterData[wMonster][3] = monsterData[wMonster][3] - 12
- end if
- if monsterData[wMonster][3] <= -175 then
- monsterData[wMonster][1] = 0
- monsterData[wMonster][2] = 0
- monsterData[wMonster][3] = -175
- end if
- set the loc of sprite wSprite to monasterInitialLocs[wMonster] + point(0, 0 - monsterData[wMonster][3])
- 4:
- if monsterData[wMonster][3] > -175 then
- monsterData[wMonster][3] = monsterData[wMonster][3] - 12
- end if
- if monsterData[wMonster][3] <= -175 then
- monsterData[wMonster][1] = 0
- monsterData[wMonster][2] = 0
- monsterData[wMonster][3] = -175
- end if
- set the loc of sprite wSprite to monasterInitialLocs[wMonster] + point(0, 0 - monsterData[wMonster][3])
- set the member of sprite wSprite to "hit " & string(monsterData[wMonster][5]) & string(appendation)
- end case
- end if
- end repeat
- end
-
- on throwBaloon
- global throwState, throwDist, startLoc, TargetLoc, idleLoc
- if throwState = 0 then
- throwState = 1
- throwDist = 0
- startLoc = idleLoc
- TargetLoc = the mouseLoc + point(0, 25)
- end if
- end
-
- on playSound whichSound, whichSlot
- global lastClear
- sound(whichSlot).stop()
- sound(whichSlot).queue([#member: member(whichSound)])
- sound(whichSlot).play()
- end
-