Urara-Blog/node_modules/.pnpm-store/v3/files/40/f1b0acf6e0abce2cf2ca90149ec17b7a8224c46e2a786ba6548356dfe83007ae7e8c7532d8bba5697a8ec12141bfcf5a2992962ac1d058a1669847de193d54
2022-08-14 01:14:53 +08:00

27 lines
No EOL
993 B
Text

private function createParticles( count ):void{
var anchorPoint = 0;
for(var i:uint = 0; i < count; i++){
var particle:Object;
if( inactiveFireParticles.length > 0 ){
particle = inactiveFireParticles.shift();
}else {
particle = new Object();
fireParticles.push( particle );
}
particle.x = uint( Math.random() * frame.width * 0.1 ) + anchors[anchorPoint];
particle.y = frame.bottom;
particle.life = 70 + uint( Math.random() * 30 );
particle.size = 5 + uint( Math.random() * 10 );
if(particle.size > 12){
particle.size = 10;
}
particle.anchor = anchors[anchorPoint] + uint( Math.random() * 5 );
anchorPoint = (anchorPoint == 9)? 0 : anchorPoint + 1;
}
}
// From https://code.tutsplus.com/tutorials/actionscript-30-optimization-a-practical-example--active-11295