- XSetLineAttributes(dpy, erase_gc, 5, 0,0,0);
- XDrawLine(dpy, window, erase_gc,
- m->startx, m->starty, m->x, m->y);
+ XSetLineAttributes(dpy, erase_gc, 4, 0,0,0);
+ /* In a perfect world, we could simply erase a line from
+ (m->startx, m->starty) to (m->x, m->y). This is not a
+ perfect world. */
+ old_x = m->startx;
+ old_y = m->starty;
+ my_pos = kMissileSpeed;
+ while (my_pos <= m->pos) {
+ m->x = m->startx + ((float) (m->endx - m->startx)) * my_pos;
+ m->y = m->starty + ((float) (m->endy - m->starty)) * my_pos;
+ XDrawLine(dpy, window, erase_gc, old_x, old_y, m->x, m->y);
+ old_x = m->x;
+ old_y = m->y;
+ my_pos += kMissileSpeed;
+ }