protected void emit( int index ) { if (target == null) { factory.emit( this, index, x + Random.Float( width ), y + Random.Float( height ) ); } else { if (fillTarget) { factory.emit( this, index, target.x + Random.Float( target.width ), target.y + Random.Float( target.height ) ); } else { factory.emit( this, index, target.x + x + Random.Float( width ), target.y + y + Random.Float( height ) ); } } }
public void start( Factory factory, float interval, int quantity ) { this.factory = factory; this.lightMode = factory.lightMode(); this.interval = interval; this.quantity = quantity; count = 0; time = Random.Float( interval ); on = true; }
protected void emit( int index ) { if (target == null) { factory.emit( this, index, x + Random.Float( width ), y + Random.Float( height ) ); } else { if (fillTarget) { factory.emit( this, index, target.x + Random.Float( target.width ), target.y + Random.Float( target.height ) ); } else { factory.emit( this, index, target.x + x + Random.Float( width ), target.y + y + Random.Float( height ) ); } } }
@Override protected void emit( int index ) { if (blob.volume <= 0) { return; } if (blob.area.isEmpty()) blob.setupArea(); int[] map = blob.cur; float size = DungeonTilemap.SIZE; int cell; for (int i = blob.area.left; i < blob.area.right; i++) { for (int j = blob.area.top; j < blob.area.bottom; j++) { cell = i + j*Dungeon.level.width(); if (cell < Dungeon.level.heroFOV.length && Dungeon.level.heroFOV[cell] && map[cell] > 0) { float x = (i + Random.Float()) * size; float y = (j + Random.Float()) * size; factory.emit(this, index, x, y); } } } } }
@Override protected void emit( int index ) { if (blob.volume <= 0) { return; } if (blob.area.isEmpty()) blob.setupArea(); int[] map = blob.cur; float size = DungeonTilemap.SIZE; int cell; for (int i = blob.area.left; i < blob.area.right; i++) { for (int j = blob.area.top; j < blob.area.bottom; j++) { cell = i + j*Dungeon.level.width(); if (cell < Dungeon.level.heroFOV.length && Dungeon.level.heroFOV[cell] && map[cell] > 0) { float x = (i + Random.Float()) * size; float y = (j + Random.Float()) * size; factory.emit(this, index, x, y); } } } } }
@Override protected void emit( int index ) { if (blob.volume <= 0) { return; } int[] map = blob.cur; float size = DungeonTilemap.SIZE; for (int i=0; i < LENGTH; i++) { if (map[i] > 0 && Dungeon.visible[i]) { float x = ( ( i % WIDTH ) + Random.Float()) * size; float y = ( ( i / WIDTH ) + Random.Float()) * size; factory.emit( this, index, x, y ); } } } }
@Override protected void emit( int index ) { RectF frame = ((Image)target).frame(); float ofsX = frame.left * mapW; float ofsY = frame.top * mapH; float x, y; do { x = Random.Float( frame.width() ) * mapW; y = Random.Float( frame.height() ) * mapH; } while ((map.getPixel( (int)(x + ofsX), (int)(y + ofsY) ) & 0x000000FF) == 0); factory.emit( this, index, target.x + x * target.scale.x, target.y + y * target.scale.y ); } }
@Override protected void emit( int index ) { RectF frame = ((Image)target).frame(); float ofsX = frame.left * mapW; float ofsY = frame.top * mapH; float x, y; do { x = Random.Float( frame.width() ) * mapW; y = Random.Float( frame.height() ) * mapH; } while ((map.bitmap.getPixel( (int)(x + ofsX), (int)(y + ofsY) ) & 0x000000FF) == 0); factory.emit( this, index, target.x + x * target.scale.x, target.y + y * target.scale.y ); } }
public void start( Factory factory, float interval, int quantity ) { this.factory = factory; this.lightMode = factory.lightMode(); this.interval = interval; this.quantity = quantity; count = 0; time = Random.Float( interval ); on = true; }
public void start( Factory factory, float interval, int quantity ) { this.factory = factory; this.lightMode = factory.lightMode(); this.interval = interval; this.quantity = quantity; count = 0; time = Random.Float( interval ); on = true; }