sparkler

modular particle system
https://github.com/RudenkoArts/sparkler

To install, run:

haxelib install sparkler 0.0.3 

See using Haxelib in Haxelib documentation for more information.

README.md

Sparkler

Modular Particle System

Overview
  • Create a ParticleSystem and add ParticleEmitter with modules that you like.
  • You can create custom ParticleModule to extend functionality.
  • Some modules need to have access to custom data, you can create components and add them to ParticleEmitter.
  • Additional modules: sparkler_modules.
  • Can support multiple engines, now only supports luxe, but you can add another backend too, or create pull request, i will add it.
Example

See sample/src/Main.hx


//...
import sparkler.ParticleSystem;
import sparkler.ParticleEmitter;
import sparkler.modules.*;

var ps:ParticleSystem;

override function ready() {

	sparkler.ParticleSystem.backend = new sparkler.backend.LuxeBackend();

	ps = new ParticleSystem();

	ps.add( 
		new ParticleEmitter({
			name : 'test_emitter', 
			rate : 30,
			cache_size : 64,
			lifetime : 1,
			lifetime_max : 2,
			cache_wrap : true,
			modules : [
				new SpawnModule(),
				new DirectionModule({
					direction_variance : 180
				}),
				new GravityModule({
					gravity : new Vector(0, 200)
				}),
				new SizeLifeModule({
					initial_scale : 1,
					end_scale : 0
				}),
			]
		})
	);

}

override function update(dt:Float) {

	ps.update(dt);

}

Contributors
RudenkoArts
Version
0.0.3
Published
2 months ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github