switch (bit_f[k]) { case 1 : // 爆炸过程 bit_vy[k] += Math.random()/100; bit_px[k] += bit_vx[k]; bit_py[k] += bit_vy[k]; bit_l[k]--; if (bit_l[k] == 0 || !rect.contains(bit_px[k], bit_py[k])) { bit_c[k] = 0x000000; bit_f[k] = 0; } else if (bit_p[k] == 0) { if (int(Math.random()*2) == 0) { bit_setwhite(int(bit_px[k]), int(bit_py[k]), 0xFFFFFFFF); } bit_set(int(bit_px[k]), int(bit_py[k]), int(bit_c[k])); } else { bit_set(int(bit_px[k]), int(bit_py[k]), int(bit_c[k])); } break; case 2 : // 上升过程 bit_sy[k] -= 5; if (bit_sy[k]<=bit_py[k]) { bit_f[k] = 1; flag2 = true; } if (int(Math.random()*20) == 0) { var i = int(Math.random()*2); var j = int(Math.random()*5); bit_set(bit_sx[k]+i, bit_sy[k]+j, 0xFFFFFF); } break; } } if (flag2) { sound2.start(0); } } function bit_set(i:Number, j:Number, k:Number) { bitmap1.setPixel(i, j, k); } function bit_setwhite(i:Number, j:Number, k:Number) { bitmap2.setPixel32(i, j, k);//白色闪光点 |