I just played around with the particles and made you an explosion. Maybe it is helpful for you?
SetErrorMode(2)
SetWindowTitle( "Explosion" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 )
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
//SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 )
// You should render the explosion BEHIND the object you destroy -
// and you should delete the graphic 0.2 secs after starting the emitter (play around to get the best result).
// You could also combine it with a centered explosion graphic (like white dust)
// for one or two frames BEFORE the emitter to conceal the emitting effect.
type explosions
starttime as integer
particleID as integer
endtype
explosion as explosions []
CreateImageColor( 1, 255, 255, 255, 255 )
ResizeImage(1,10,10)
do
currenttime=GetMilliseconds()
if GetPointerPressed()
mousex=GetPointerX()
mousey=GetPointerY()
particleID=CreateParticles(mousex,mousey)
SetParticlesImage(particleID,1)
SetParticlesStartZone(particleID,0,0,0,0)
SetParticlesDirection(particleID,100,0)
SetParticlesAngle(particleID,360) // emits particles around the full circle
SetParticlesFrequency(particleID,1000) // large number of particles in a short time
SetParticlesLife(particleID,2)
SetParticlesSize(particleID,10)
SetParticlesMax(particleID,200) // 200 particles for each explosion
SetParticlesVelocityRange(particleID,0,3)
AddParticlesColorKeyFrame(particleID,0,255,255,255,255)
AddParticlesColorKeyFrame(particleID,0.2,255,255,200,255)
AddParticlesColorKeyFrame(particleID,0.5,255,240,200,255)
AddParticlesColorKeyFrame(particleID,1,100,20,0,255)
AddParticlesColorKeyFrame(particleID,2,0,0,0,0)
AddParticlesForce(particleID,0.3,2,0,150) // a touch of gravity on each particle
thisexplosion as explosions
thisexplosion.starttime=currenttime
thisexplosion.particleID=particleID
explosion.insert(thisexplosion)
endif
if explosion.length <> -1
for i=0 to explosion.length
if currenttime-explosion[i].starttime>=2000
DeleteParticles(explosion[i].particleID)
explosion.remove(i)
endif
next i
endif
print("Click for fireworks.")
print("Explosions on Screen: "+str(explosion.length+1))
Print( ScreenFPS() )
Sync()
loop