Skip to content

AndreiRudenko/sparkler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sparkler

A modular 2d particle system.

Features

  • Macro-powered.
  • Customizable.
  • You can create custom ParticleModule to extend functionality.
  • Local/World Space rendering.
  • Multiple frameworks support: Kha and Clay for now.

Sample Usage

var emitter = new ParticleEmitter<
	ColorListOverLifetimeModule,
	InitialVelocityModule,
	KhaSpriteRendererModule
>({
	cacheSize: 512,
	lifetime: 2,
	emitterLifetime: 5,
	emitRate: 50,
	colorListOverLifetime: {
		ease: null,
		list: [
			{
				time: 0,
				value: 0xFFFF0000
			},
			{
				time: 0.5,
				value: 0xFFFF00FF
			},
			{
				time: 1,
				value: 0x00FF00FF
			}
		]
	},
	initialVelocity: {x: 0, y: -200},
	khaSpriteRenderer: {
		image: kha.Assets.images.particle
	},
	sortFunc: function(a, b) {
		return a.age < b.age ? 1 : -1;
	}
});

emitter.start();

About

Modular Macro-powered Particle System for haxe

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages