JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
started ship in the middle vertically (instead of the top of the ship in the middle)
[vor.git] / main.c
diff --git a/main.c b/main.c
index 06f46c1..0001c99 100644 (file)
--- a/main.c
+++ b/main.c
@@ -223,7 +223,7 @@ draw_bang_dots(SDL_Surface *s)
        pixels = (uint16_t *) s->pixels;
 
        for(i=0; i<MAXBANGDOTS; i++) {
-               if(bdot[i].active) continue;
+               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];
@@ -681,9 +681,9 @@ gameloop() {
                        }
 
                        // SCROLLING
-                       tmp = (ship.y+ship.dy*t_frame-YSCROLLTO)/25 + (ship.dy-screendy);
+                       tmp = (ship.y+ship.h/2+ship.dy*t_frame-YSCROLLTO)/25 + (ship.dy-screendy);
                        screendy += tmp * t_frame/12;
-                       tmp = (ship.x+ship.dx*t_frame-XSCROLLTO)/25 + (ship.dx-screendx);
+                       tmp = (ship.x+ship.w/2+ship.dx*t_frame-XSCROLLTO)/25 + (ship.dx-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).
@@ -763,7 +763,7 @@ gameloop() {
                                        reset_rocks();
                                        screendx = SCREENDXMIN; screendy = 0;
 
-                                       ship.x = XSIZE/2.2; ship.y = YSIZE/2;
+                                       ship.x = XSIZE/2.2; ship.y = YSIZE/2 - ship.w/2;
                                        ship.dx = screendx; ship.dy = screendy;
                                        ship.lives = 4;
                                        ship.flags = MOVE|DRAW|COLLIDE;