X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=main.c;h=b5dc64d79f0c302fab56530bae7b9573374a8450;hp=a0b50ccd19ec0cdd4a03dab1e25be521c0f13fe8;hb=0bbc23a37289ca20b8681229ccf74edfb6261d4e;hpb=cd7fb220b16a73c15ff9dff7a5627bf78478875f diff --git a/main.c b/main.c index a0b50cc..b5dc64d 100644 --- a/main.c +++ b/main.c @@ -329,7 +329,7 @@ init(void) { // Initialize SDL with audio and video if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0) { opt_sound = 0; - printf ("Can't open sound, starting without it\n"); + fputs("Can't open sound, starting without it\n", stderr); atexit(SDL_Quit); } else { atexit(SDL_Quit); @@ -600,14 +600,10 @@ gameloop() { new_rocks(); - // INERTIA - shipx += shipdx*t_frame; - shipy += shipdy*t_frame; - // SCROLLING - tmp = (shipy-YSCROLLTO)/25 + (shipdy-screendy); + tmp = (shipy+shipdy*t_frame-YSCROLLTO)/25 + (shipdy-screendy); screendy += tmp * t_frame/12; - tmp = (shipx-XSCROLLTO)/25 + (shipdx-screendx); + tmp = (shipx+shipdx*t_frame-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). @@ -621,8 +617,8 @@ gameloop() { xscroll = screendx * t_frame; yscroll = screendy * t_frame; - shipx -= xscroll; - shipy -= yscroll; + shipx += shipdx*t_frame - xscroll; + shipy += shipdy*t_frame - yscroll; // move bang center bangx += bangdx*t_frame - xscroll;