openfl-simple-particles icon indicating copy to clipboard operation
openfl-simple-particles copied to clipboard

Default values

Open Dvergar opened this issue 11 years ago • 0 comments

Default values make the library use a bit misleading. I guess the point is to have some kind of default particle effect.

If i set direction i also need to set speed because defaulted to 0. I need to set myself start_size end_size when it should probably be set to the image size. gravity is at -180, really annoying when you try to debug direction :3

But for a real issue :

if(direction != 0) {
    var new_dir = (direction + direction_random * random_1_to_1() ) * ( Math.PI / 180 ); // convert to radians
    direction_vector.setTo( Math.cos( new_dir ), Math.sin( new_dir ) ); 
} else {
    direction_vector.setTo(0,0);
}
  • A direction of 0 should actually make a direction_vector of (1, 0) to be consistent here.
  • If i set direction_random for a direction of 0 it wouldn't have any effect because once direction != 0 the block containing direction_random is skipped.
  • Setting direction_vector when creating the emitter is useless because overridden by the block above.

This is more a note for myself in case i'm brave enough for a PR.

Dvergar avatar May 16 '14 12:05 Dvergar