home *** CD-ROM | disk | FTP | other *** search
- global particleSO, maxParticles, particle_RefList, particleData, playerViewPoint
-
- on initializeParticlereference
- particle_RefList = []
- sequenceNamelist = ["Bubble_Small 1", "Bubble_Small 2", "Bubble_Small 3"]
- add(particle_RefList, [sequenceNamelist, 3, 3, 32])
- sequenceNamelist = ["Bubble_Small 1", "Bubble_Small 2", "Bubble_Small 3"]
- add(particle_RefList, [sequenceNamelist, 3, 5, 32])
- sequenceNamelist = ["Bubble_Small 1"]
- add(particle_RefList, [sequenceNamelist, 1, 1, 32])
- sequenceNamelist = ["Green Flare"]
- add(particle_RefList, [sequenceNamelist, 1, 1, 33])
- sequenceNamelist = ["Blue Flare"]
- add(particle_RefList, [sequenceNamelist, 1, 1, 33])
- end
-
- on initializeParticles
- particleData = []
- repeat with wPart = 1 to maxParticles
- wSprite = particleSO + wPart
- puppetSprite(wSprite, 1)
- set the loc of sprite wSprite to point(-50, 50)
- set the ink of sprite wSprite to 33
- add(particleData, [0, 0, point(0, 0), point(0, 0), 0, 0])
- end repeat
- end
-
- on addparticle spawnType, spawnloc, spawnMomentum
- validSlot = 0
- repeat with wSlot = 1 to maxParticles
- if (validSlot = 0) and (particleData[wSlot][1] = 0) then
- validSlot = wSlot
- end if
- end repeat
- if validSlot <> 0 then
- if spawnType = 11 then
- spawnMomentum = point(0, 0)
- end if
- particleData[validSlot] = [1, spawnType, spawnloc, spawnMomentum, 1, 0]
- wSprite = particleSO + validSlot
- set the member of sprite wSprite to particle_RefList[spawnType][1][1]
- set the loc of sprite wSprite to (spawnloc - playerViewPoint) / 10
- set the ink of sprite wSprite to particle_RefList[spawnType][4]
- end if
- end
-
- on moveParticles
- repeat with wSlot = 1 to maxParticles
- if particleData[wSlot][1] = 1 then
- wSprite = particleSO + wSlot
- pType = particleData[wSlot][2]
- frameNames = particle_RefList[pType][1]
- maxFrames = particle_RefList[pType][2]
- maxDelay = particle_RefList[pType][3]
- canDraw = 0
- if findDistance(playerViewPoint + point(2900, 2200), particleData[wSlot][3]) <= 3800 then
- canDraw = 1
- end if
- particleData[wSlot][6] = particleData[wSlot][6] + 1
- termination = 0
- if particleData[wSlot][6] > maxDelay then
- particleData[wSlot][5] = particleData[wSlot][5] + 1
- particleData[wSlot][6] = 0
- if particleData[wSlot][5] > maxFrames then
- termination = 1
- else
- if canDraw = 1 then
- set the member of sprite wSprite to frameNames[particleData[wSlot][5]]
- end if
- end if
- end if
- if termination = 1 then
- set the loc of sprite wSprite to point(-50, 50)
- particleData[wSlot][1] = 0
- next repeat
- end if
- particleData[wSlot][3] = particleData[wSlot][3] + particleData[wSlot][4]
- if canDraw = 1 then
- set the loc of sprite wSprite to (particleData[wSlot][3] - playerViewPoint) / 10
- end if
- end if
- end repeat
- end
-