home *** CD-ROM | disk | FTP | other *** search
- global particleSO, maxParticles, particle_RefList, particleData, playerViewpoint
-
- on initializeParticlereference
- particle_RefList = []
- sequenceNamelist = ["Light Impact 1", "Light Impact 2", "Light Impact 3", "Light Impact 4"]
- add(particle_RefList, [sequenceNamelist, 4, 0, 36, 25])
- sequenceNamelist = ["TBlast 1", "TBlast 2", "TBlast 3", "TBlast 4", "TBlast 5", "TBlast 6", "TBlast 7", "TBlast 8", "TBlast 9", "TBlast 10", "TBlast 11", "TBlast 12", "TBlast 12", "TBlast 13"]
- add(particle_RefList, [sequenceNamelist, 7, 0, 36, 25])
- sequenceNamelist = ["Sparkle 1", "Sparkle 2", "Sparkle 3"]
- add(particle_RefList, [sequenceNamelist, 3, 0, 36, 25])
- sequenceNamelist = ["SBlast 1", "SBlast 2", "SBlast 3", "SBlast 4", "SBlast 5", "SBlast 6", "SBlast 7", "SBlast 8", "SBlast 9", "SBlast 10", "SBlast 11"]
- add(particle_RefList, [sequenceNamelist, 11, 0, 33, 12])
- sequenceNamelist = ["Blast 1", "Blast 2", "Blast 3", "Blast 4", "Blast 5", "Blast 6", "Blast 7", "Blast 8", "Blast 9", "Blast 10", "Blast 11", "Blast 12", "Blast 13"]
- add(particle_RefList, [sequenceNamelist, 11, 0, 33, 25])
- sequenceNamelist = ["LowPoints 1"]
- add(particle_RefList, [sequenceNamelist, 1, 30, 36, 25])
- sequenceNamelist = ["HighPoints 1"]
- add(particle_RefList, [sequenceNamelist, 1, 30, 36, 25])
- end
-
- on initializeParticles
- playerViewpoint = point(0, 0)
- 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 36
- 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]
- sprite(wSprite).locZ = particle_RefList[spawnType][5]
- sprite(wSprite).flipH = random(2) - 1
- sprite(wSprite).flipV = random(2) - 1
- 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
-