home *** CD-ROM | disk | FTP | other *** search
- global bgOffset
-
- on init_ParticleConstants
- global p_StartSprite, p_MaxParticles, p_MaxFrames, p_FrameDelay, p_FrameTitle, p_StartFade, p_FadeIncrement, p_InkType, p_SpawnTimer, p_lockParticles, p_LockPic, p_StartSize, p_ScaleRate, p_RotatePic
- p_StartSprite = 350
- p_MaxParticles = 8
- p_MaxFrames = [11, 11, 7, 6, 10, 4, 4, 1]
- p_FrameDelay = [1, 1, 1, 1, 3, 1, 1, 1]
- p_FrameTitle = ["Blast", "SBlast", "tBlast", #Specific, #Specific, "Gold Sparkle", "Angry Flash", "Bubble"]
- p_StartFade = [100, 100, 100, 70, 70, 100, 100, 100]
- p_FadeIncrement = [0, 0, 0, -10, -5, 0, 0, 0]
- p_InkType = [33, 33, 33, 36, 36, 36, 39, 33]
- p_SpawnTimer = 0
- p_RandomFlip = 0
- p_RotatePic = 1
- p_LockPic = [0, 0, 0, 1, 1, 0, 0, 0]
- p_StartSize = point(6, 15)
- p_ScaleRate = point(0, 0)
- p_lockParticles = 1
- end
-
- on init_Particles
- global p_StartSprite, p_MaxParticles, p_MaxFrames, p_FrameDelay, p_FrameTitle, p_StartFade, p_FadeIncrement, p_InkType, p_SpawnTimer, particleData
- particleData = []
- repeat with wEntry = 1 to p_MaxParticles
- wSprite = p_StartSprite + wEntry - 1
- add(particleData, [0, 0, 0, point(0, 0)])
- sprite(wSprite).visible = 0
- puppetSprite(wSprite, 1)
- set the member of sprite wSprite to p_FrameTitle[1] & " 1"
- set the loc of sprite wSprite to point(0, 0)
- sprite(wSprite).locZ = 450
- end repeat
- end
-
- on addparticle spawnPoint, SpawnRotate, spawnType, membernm, memberFlip
- global p_StartSprite, p_MaxParticles, p_MaxFrames, p_FrameDelay, p_FrameTitle, p_StartFade, p_FadeIncrement, p_InkType, p_SpawnTimer, p_RotatePic, particleData, p_lockParticles
- if p_lockParticles = 1 then
- validSlot = 0
- repeat with wSlot = 1 to p_MaxParticles
- if (validSlot = 0) and (particleData[wSlot][1] = 0) then
- validSlot = wSlot
- end if
- end repeat
- if validSlot <> 0 then
- particleData[validSlot] = [spawnType, 0, 0, spawnPoint]
- wSprite = p_StartSprite + validSlot - 1
- set the loc of sprite wSprite to spawnPoint + bgOffset
- if membernm.ilk = #string then
- set the member of sprite wSprite to p_FrameTitle[spawnType] & " 1"
- else
- set the member of sprite wSprite to membernm
- sprite(wSprite).flipH = memberFlip
- end if
- set the blend of sprite wSprite to p_StartFade[spawnType]
- sprite(wSprite).rotation = SpawnRotate
- set the ink of sprite wSprite to p_InkType[spawnType]
- sprite(wSprite).visible = 1
- end if
- end if
- end
-
- on moveParticles
- global p_StartSprite, p_MaxParticles, p_MaxFrames, p_FrameDelay, p_FrameTitle, p_StartFade, p_FadeIncrement, p_InkType, p_SpawnTimer, p_LockPic, p_StartSize, p_ScaleRate, particleData, playerViewpoint, rumbleOffset
- p_SpawnTimer = p_SpawnTimer + 1
- if p_SpawnTimer > 36500 then
- p_SpawnTimer = 1
- end if
- repeat with wEntry = 1 to p_MaxParticles
- wSprite = p_StartSprite + wEntry - 1
- if particleData[wEntry][1] <> 0 then
- eType = particleData[wEntry][1]
- if particleData[wEntry][3] <= 1 then
- particleData[wEntry][3] = p_FrameDelay[eType]
- particleData[wEntry][2] = particleData[wEntry][2] + 1
- if particleData[wEntry][2] > p_MaxFrames[eType] then
- particleData[wEntry][1] = 0
- sprite(wSprite).visible = 0
- set the loc of sprite wSprite to point(-50, -50)
- else
- if p_LockPic[eType] = 0 then
- if p_FrameTitle[eType] <> #Specific then
- set the member of sprite wSprite to p_FrameTitle[eType] & " " & string(particleData[wEntry][2])
- end if
- else
- set the blend of sprite wSprite to p_StartFade[eType] + (p_FadeIncrement[eType] * particleData[wEntry][2])
- end if
- end if
- else
- particleData[wEntry][3] = particleData[wEntry][3] - 1
- end if
- set the loc of sprite wSprite to particleData[wEntry][4] - playerViewpoint + rumbleOffset
- next repeat
- end if
- end repeat
- end
-