- dotptr->x = shipx + surf_ship->w/2 + (rnd()-0.5)*3;
- dotptr->y = shipy + surf_ship->h/2 + (rnd()-0.5)*3;
-
- switch(m) {
- case 0:
- dotptr->x -= 14;
- dotptr->dx = -20*adx + shipdx;
- dotptr->dy = 2*dy + shipdy;
- dotptr->life = 60 * adx;
- break;
- case 1:
- dotptr->dx = 2*dx + shipdx;
- dotptr->dy = -20*ady + shipdy;
- dotptr->life = 60 * ady;
- break;
- case 2:
- dotptr->x += 14;
- dotptr->dx = 20*adx + shipdx;
- dotptr->dy = 2*dy + shipdy;
- dotptr->life = 60 * adx;
- break;
- case 3:
- dotptr->dx = 2*dx + shipdx;
- dotptr->dy = 20*ady + shipdy;
- dotptr->life = 60 * ady;
- break;
+ dotptr->x = shipx + s[dir]*hx + (rnd()-0.5)*3;
+ dotptr->y = shipy + s[(dir+1)&3]*hy + (rnd()-0.5)*3;
+ if(dir&1) {
+ dotptr->dx = shipdx + 2*dx;
+ dotptr->dy = shipdy + 20*dy;
+ dotptr->life = 60 * fabs(dy);
+ } else {
+ dotptr->dx = shipdx + 20*dx;
+ dotptr->dy = shipdy + 2*dy;
+ dotptr->life = 60 * fabs(dx);