fx stuff

Blitz3D Forums/Blitz3D Programming/fx stuff

For want of not comparing particle systems...

; spawn_particle function
;
; Usage: spawn_particle(x#,y#,z#,delx#,dely#,delz#
;                       start_rot,rot#,life,
;                       start_scale#,end_scale#,
;                       gravity#,graphic,fx$,name$="")


; set up particle type
Type particle
Field mesh				 ;sprite
Field xd#				 ;x delta
Field yd#				 ;y delta
Field zd#				 ;z delta
Field rot				 ;rotation
Field rot_speed#		 ;rotation speed
Field life				 ; life
Field max_life			 ; total life
Field scale#			 ; scale
Field grav_fx#			 ; effect of gravity
Field growth#			 ; scale delta
Field priority			 ; is a priority particle (true/false)
Field alpha				 ; alpha fade (true/false)
Field colour			 ; colour fade (true/false)
Field red#				 ; red component (for colour fading)
Field green#			 ; green component (for colour fading)
Field blue#				 ; blue component (for colour fading)
Field red_delta#		 ; red component delta (for colour fading)
Field green_delta#		 ; green component delta (for colour fading)
Field blue_delta#		 ; blue component delta (for colour fading)
Field name$				 ; death name for death list
Field sound
End Type

Type death
Field name$
Field x#
Field y#
Field z#
Field xd#
Field yd#
Field zd#
End Type


If a particle is given a name when it dies it gets added to the death list... you can then spawn another bunch of particles or whatever from the contents of the death list.

The FX string tells you about if it alpha fades, colour fades or not... for example AC0F0F00 will alpha fade and fade from green to red.