X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=main.c;h=71f014bed52edcfe3f5758f159e1f4ada1c40487;hp=03d173c9c875921b4f2f0fca00f216ce39eadd9f;hb=5abd974b9e8aee28979e797d52eb5a71dd8b10ff;hpb=cf30b5f20e3c6fa5c6a328f6cb9ad1559cf227a2 diff --git a/main.c b/main.c index 03d173c..71f014b 100644 --- a/main.c +++ b/main.c @@ -1002,15 +1002,8 @@ int gameloop() { // Create a new ship and start all over again state = GAMEPLAY; play_tune(1); - xship = 10; - yship = YSIZE/2; xvel = 3; yvel = 0; - for(i = 0; i YSIZE) { - rock[i].y -= YSIZE; - rock[i].y -= rock[i].image->w; - } else if(rock[i].y < -rock[i].image->w) { - rock[i].y += YSIZE; - rock[i].y += rock[i].image->w; - } - if(rock[i].x<-32.0) - rock[i].active = 0; + if(rock[i].y > YSIZE) { + rock[i].y -= YSIZE; + rock[i].y -= rock[i].image->w; + } else if(rock[i].y < -rock[i].image->w) { + rock[i].y += YSIZE; + rock[i].y += rock[i].image->w; + } + if(rock[i].x < -32.0) rock[i].active = 0; } @@ -1148,7 +1154,10 @@ int gameloop() { else { state = DEAD_PAUSE; state_timeout = 50.0; - + xship = 10; + yship = YSIZE/2; + xvel = 0; + yvel = 0; } }