home *** CD-ROM | disk | FTP | other *** search
- 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 = 120
- p_MaxParticles = 30
- p_MaxFrames = 20
- p_FrameDelay = 1
- p_FrameTitle = "Bubble bg"
- p_StartFade = 100
- p_FadeIncrement = -5
- p_InkType = 37
- p_SpawnTimer = 0
- p_RandomFlip = 0
- p_RotatePic = 1
- p_LockPic = 1
- p_StartSize = point(6, 15)
- p_ScaleRate = point(0.29999999999999999, 0.75)
- if p_FrameDelay < 1 then
- p_FrameDelay = 1
- end if
- if p_StartFade < 1 then
- p_StartFade = 1
- end if
- if p_StartFade > 100 then
- p_StartFade = 100
- end if
- 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, particleDataBG
- particleDataBG = []
- repeat with wEntry = 1 to p_MaxParticles
- wSprite = p_StartSprite + wEntry - 1
- add(particleDataBG, [0, 0, 0, point(0, 0)])
- sprite(wSprite).visible = 0
- puppetSprite(wSprite, 1)
- set the member of sprite wSprite to p_FrameTitle
- set the ink of sprite wSprite to p_InkType
- set the loc of sprite wSprite to point(0, 0)
- end repeat
- end
-
- on addParticleBG spawnPoint, SpawnRotate
- global p_StartSprite, p_MaxParticles, p_MaxFrames, p_FrameDelay, p_FrameTitle, p_StartFade, p_FadeIncrement, p_InkType, p_SpawnTimer, p_RotatePic, particleDataBG, p_lockParticles
- if p_lockParticles = 1 then
- validSlot = 0
- repeat with wSlot = 1 to p_MaxParticles
- if (validSlot = 0) and (particleDataBG[wSlot][1] = 0) then
- validSlot = wSlot
- end if
- end repeat
- if validSlot <> 0 then
- particleDataBG[validSlot] = [1, 0, 0, spawnPoint]
- wSprite = p_StartSprite + validSlot - 1
- set the loc of sprite wSprite to spawnPoint
- set the member of sprite wSprite to "BG Bubble_Small " & string(random(3))
- set the blend of sprite wSprite to 100
- sprite(wSprite).rotation = 0
- sprite(wSprite).visible = 1
- sprite(wSprite).locZ = 1
- end if
- end if
- end
-
- on moveParticlesBG
- 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, particleDataBG
- 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 particleDataBG[wEntry][1] = 1 then
- if particleDataBG[wEntry][4][1] > -20 then
- moveXSpeed = 4 + (wEntry mod 3 * (wEntry mod 5))
- particleDataBG[wEntry][4] = particleDataBG[wEntry][4] + point(0 - moveXSpeed, 0)
- set the loc of sprite wSprite to particleDataBG[wEntry][4]
- else
- particleDataBG[wEntry][1] = 0
- end if
- next repeat
- end if
- end repeat
- end
-