-move_bang_dots(float ticks)
-{
- int i;
- Sprite *hit;
-
- for(i=0; i<MAXBANGDOTS; i++) {
- if(!bdot[i].active) continue;
-
- // decrement life and maybe kill
- bdot[i].life -= bdot[i].decay * ticks/2.0;
- if(bdot[i].life < 0) { bdot[i].active = 0; continue; }
-
- // move and clip
- bdot[i].x += (bdot[i].dx - screendx)*ticks;
- bdot[i].y += (bdot[i].dy - screendy)*ticks;
- if(bdot[i].x < 0 || bdot[i].x >= (XSIZE - 0.000001) || bdot[i].y < 0 || bdot[i].y >= (YSIZE - 0.000001)) {
- bdot[i].active = 0;
- continue;
- }
-
- // check collisions
- if((hit = pixel_collides(bdot[i].x, bdot[i].y))) {
- if(hit->type != SHIP) { // they shouldn't hit the ship, but they do
- bdot[i].active = 0;
- hit->dx += ENGINE_DOT_WEIGHT * bdot[i].life * bdot[i].dx / sprite_mass(hit);
- hit->dy += ENGINE_DOT_WEIGHT * bdot[i].life * bdot[i].dy / sprite_mass(hit);
- continue;
- }
- }
- }
-}
-
-
-void
-draw_bang_dots(SDL_Surface *s)
-{
- int i;
- uint16_t *pixels, *pixel, c;
- int row_inc = s->pitch/sizeof(uint16_t);
-
- pixels = (uint16_t *) s->pixels;
-
- for(i=0; i<MAXBANGDOTS; i++) {
- if(!bdot[i].active) continue;
-
- pixel = pixels + row_inc*(int)(bdot[i].y) + (int)(bdot[i].x);
- if(bdot[i].c) c = bdot[i].c; else c = heatcolor[(int)(bdot[i].life)*3];
- *pixel = c;
- }
-}
-
-
-void
-new_engine_dots(float time_span) {