I have been particle-happy recently and made this little snippet. I must say that I'm quite happy with myself. Would do you all think?
FLARE.PNG

GLOW.PNG

If you like the code and/or images then you may have them but please credit me in any form of the releases.
CODE (BLITZ3D)
FLARE.PNG

GLOW.PNG

If you like the code and/or images then you may have them but please credit me in any form of the releases.
CODE (BLITZ3D)
screenwidth=640 screenheight=480 Graphics3D screenwidth,screenheight,32,2 SetBuffer BackBuffer() Global flaresprite=LoadSprite("flare.png",1):HideEntity flaresprite Global halfwidth=screenwidth/2,halfheight=screenheight/2 Global glowsprite=LoadSprite("glow.png",1):HideEntity glowsprite Global camera=CreateCamera() Global light=CreateLight() Type flare Field x,y Field angle# Field speed# Field alpha# Field src End Type Type glow Field x,y Field alpha# Field src End Type While Not KeyHit(1) RenderWorld:Flip:UpdateWorld If KeyHit(57) x=Rand(100,screenwidth-100) y=Rand(100,screenheight-100) CreateGlow(x,y) For i=1 To 30 CreateExplosion(x,y) Next EndIf UpdateGlow() UpdateExplosion() Wend End Function CreateGlow(x,y) g.glow=New glow g\x=x g\y=y g\alpha=1.0 g\src=CopyEntity(glowsprite) ScaleSprite g\src,200/2,200/2 End Function Function UpdateGlow() For g.glow=Each glow g\alpha=g\alpha-0.05 If g\alpha > 0 PositionEntity g\src,halfwidth-g\x,g\y-halfheight,halfwidth*1 EntityAlpha g\src,g\alpha Else FreeEntity g\src Delete g EndIf Next End Function Function CreateExplosion(x,y) f.flare=New flare f\x=x f\y=y f\angle=Rand(360) f\speed=Rand(3,7) f\alpha=1.0 f\src=CopyEntity(flaresprite) RotateSprite f\src,f\angle ScaleSprite f\src,50/2,50/2 End Function Function UpdateExplosion() For f.flare=Each flare If f\alpha>0 f\x=f\x+Sin(f\angle)*f\speed f\y=f\y+Cos(f\angle)*f\speed If f\angle > 180 f\angle=f\angle-0.5 ElseIf f\angle < 180 f\angle=f\angle+0.5 EndIf f\alpha=f\alpha-0.01 PositionEntity f\src,halfwidth-f\x,f\y-halfheight,halfwidth*1 EntityAlpha f\src,f\alpha RotateSprite f\src,f\angle Else FreeEntity f\src Delete f EndIf Next End Function