rather nice
I had a play with the fireworks demo, see my image below and modified code. You can fire off up to 100 rockets at a time for a nice effect.
DB Pro code:
`*************************************************************************
` Project: Fire Works Demo
` Created: 6/9/2007 11:46:38 AM
`
` ***** Main Source File *****
`
`*************************************************************************
` This demo utilizes the zParticle plugin (Zerk Particle System Plugin)
` By Eric PL Smith (Zerk) erics@battlecraft42.com
`*************************************************************************
sync on
sync rate 60
backdrop on : autocam off : hide mouse
`if check display mode(1024,768,32)=1 then set display mode 1024,768,32
color backdrop rgb(0,0,0)
global runTime=0
global deltaTime#=0.0
global lastTime=0
randomize timer()
load image "medianightsky.jpg",1
make object box 2,500,500,500
texture object 2,1
set object cull 2,0
set object light 2,0
position object 2, 0, 0,0
ZP Load "fireworks.zpi"
type tFireWork
emitter1
emitter2
x1 as float
y1 as float
z1 as float
x2 as float
y2 as float
z2 as float
fireworkPos as float
posx as float
velx as float
launched
endtype
dim fw(100) as tFirework
for n = 1 to 100
fw(n).emitter1 = n
fw(n).emitter2 = n + 100
fw(n).x1 = 0
fw(n).y1 = 125
fw(n).z1 = 250
fw(n).x2 = 0
fw(n).y2 = -150
fw(n).z2 = 250
ZP Create Emitter fw(n).emitter1, "FireWork1", fw(n).x1,fw(n).y1,fw(n).z1
ZP Create Emitter fw(n).emitter2, "Tracer", fw(n).x2,fw(n).y2,fw(n).z2
ZP Enable Emitter fw(n).emitter1, 0
ZP Enable Emitter fw(n).emitter2, 0
next n
position camera 0, 14, -60
global spacePress
global nextFireWork
spacePress = 0
nextFirework = 1
`*************************************************************************
`MAIN LOOP
`*************************************************************************
lastTime=timer()
do
runTime=timer()
deltaTime#=(runTime-lastTime)*0.001
ZP Update
if spacePress = 0
if spacekey() = 1
spacePress = 1
ZP Enable Emitter fw(nextFirework).emitter2, 1
fw(nextFirework).fireworkPos = -150.0
fw(nextFirework).velx = (rnd(40)-20)*0.05
fw(nextFirework).posx = -20 + rnd(40)
fw(nextFirework).launched = 1
inc nextFirework, 1
if nextFirework > 100 then nextFireWork = 1
endif
else
spacePress = spaceKey()
endif
for n = 1 to 100
if fw(n).launched = 1
fw(n).fireworkPos = fw(n).fireworkPos + deltaTime#*100.0
fw(n).posx = fw(n).posx + fw(n).velx
ZP Position Emitter fw(n).emitter2, fw(n).posx, fw(n).fireworkPos, 250.0
if fw(n).fireworkPos > 125.0
ZP Position Emitter fw(n).emitter1, fw(n).posx, fw(n).fireworkPos, 250.0
ZP Enable Emitter fw(n).emitter1, 1
ZP Enable Emitter fw(n).emitter2, 0
fw(n).launched = 0
endif
endif
next n
set cursor 10,10:print "Press 'SPACEBAR' to launch a firework"
sync
lastTime = runTime
loop
ZPI file:
//Zerks Particles demo particle and emitter file
emitter:create=Tracer
emitter:particle=TracerParticle
emitter:texture=mediabigflare.bmp
emitter:renderType=GLOW
emitter:maxParticles=0
emitter:rate=0.01
emitter:force=0.0
emitter:burst=0
emitter:velocityX=0.0
emitter:velocityY=0.0
emitter:velocityZ=0.0
particle:create=TracerParticle
particle:life=1.0
particle:startSpread=2.0
particle:sizeStartMin=5.2
particle:sizeStartMax=5.4
particle:sizeMid=1.0
particle:sizeEnd=0.0
particle:sizeMidPosition=0.05
particle:fadeStart=1.0
particle:fadeMid=1.0
particle:fadeEnd=0.0
particle:fadeMidPosition=0.95
particle:gravity=0
particle:colorStart=255/255/255
particle:colorMid=255/255/0
particle:colorEnd=255/0/0
particle:colorMidPosition=0.5
particle:frameWidth=1
particle:frameHeight=1
particle:frameRate=5.0
particle:frameLoops=1
particle:rotation=0.0
particle:randomRotation=0
particle:rotateToRight=0
emitter:create=Firework1
emitter:particle=FireworkParticle
emitter:texture=mediatest.dds
emitter:renderType=GLOW
emitter:maxParticles=0
emitter:rate=0.001
emitter:force=20.0
emitter:burst=100
emitter:velocityX=0.0
emitter:velocityY=10.0
emitter:velocityZ=0.0
particle:create=FireworkParticle
particle:life=2.5
particle:startSpread=0.0
particle:sizeStartMin=0.2
particle:sizeStartMax=0.4
particle:sizeMid=10.0
particle:sizeEnd=0.01
particle:sizeMidPosition=0.05
particle:fadeStart=1.0
particle:fadeMid=0.0
particle:fadeEnd=1.0
particle:fadeMidPosition=0.10
particle:gravity=-30
particle:colorStart=255/255/255
particle:colorMid=255/0/255
particle:colorEnd=255/255/255
particle:colorMidPosition=0.75
particle:frameWidth=1
particle:frameHeight=1
particle:frameRate=5.0
particle:frameLoops=1
particle:rotation=200.0
particle:randomRotation=1
particle:rotateToRight=0
//EOF