HaxeFlixel/flixel — pull request #1174 by steverichey (2014-06-12 22:10:16+00:00)
Title: FlxEmitter refactor (do not merge), closes #587

This is a pull request for a refactoring of `FlxEmitter`, which has several goals:

* Merge `FlxEmitter` and `FlxEmitterExt`
* Remove redundant variables (`lifespan` and `life`, `x` and `y` and `xPosition` and `yPosition`
* Create a consistent logic for setting start, end, min, and max values (see `Range`, `Bounds`, `RangeBounds` and `FlxPointRangeBounds`)
* Rename variables to be consistent with `FlxSprite` (`angularVelocity` instead of `rotation`)
* Allow greater control over start, end, min, and max values

This is very much a WIP, but I wanted to get some feedback on the changes early. Usage:

````
_emitter = new FlxEmitter(10, 10, 200); // unchanged
_emitter.velocity.setAll(100, -50, null, null, 200, 50); // finer control over velocity
_emitter.elasticity.setAll(0.8); // elasticity vs. bounce
````

Basically everything will be `Bounds`, `RangeBounds`, `Range`, or `FlxPointRangeBounds`, allowing devs to set variables with a logical method (e.g. `velocity.start.min.x = 5;`) or all at once via `setAll()`.

Comments appreciated! Thanks!