- tmp = shipy - (YSIZE / 2);
- tmp += 25 * shipdy;
- tmp /= -25;
- tmp = ((screendy * (gamerate - 12)) + (tmp * gamerate)) / 12;
- screendy = -tmp;
- xscroll = screendx * gamerate;
- yscroll = screendy * gamerate;
+ tmp = (shipy-YSCROLLTO)/25 + (shipdy-screendy);
+ screendy += tmp * t_frame/12;
+ tmp = (shipx-XSCROLLTO)/25 + (shipdx-screendx);
+ screendx += tmp * t_frame/12;
+ // taper off so we don't hit the barrier abruptly.
+ // (if we would hit in < 2 seconds, adjust to 2 seconds).
+ if(back_dist + (screendx - SCREENDXMIN)*TO_TICKS(2) < 0) {
+ screendx = SCREENDXMIN - (back_dist/TO_TICKS(2));
+ }
+
+ back_dist += (screendx - SCREENDXMIN)*t_frame;
+ if(opt_max_lead >= 0) back_dist = min(back_dist, opt_max_lead);
+
+ xscroll = screendx * t_frame;
+ yscroll = screendy * t_frame;
+
+ shipx -= xscroll;
+ shipy -= yscroll;
+
+ // move bang center
+ bangx += bangdx*t_frame - xscroll;
+ bangy += bangdy*t_frame - yscroll;