X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=main.c;h=662aa97cf2e15793ca0f4bd19edcd7b6e697ca4e;hp=71f014bed52edcfe3f5758f159e1f4ada1c40487;hb=5653fa3092dd1821ca9f50cf85210de4d05a3cf9;hpb=5abd974b9e8aee28979e797d52eb5a71dd8b10ff diff --git a/main.c b/main.c index 71f014b..662aa97 100644 --- a/main.c +++ b/main.c @@ -1002,6 +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; break; @@ -1053,11 +1055,13 @@ int gameloop() { float blast_radius = START_RAD * state_timeout / 50.0; for(i = 0; iw; } if(rock[i].x < -32.0) rock[i].active = 0; + if(rock[i].xvel > 0) { + if(rock[i].y < 0 || rock[i].y > YSIZE) rock[i].active = 0; + if(rock[i].x > XSIZE) rock[i].active = 0; + } } @@ -1154,10 +1162,6 @@ int gameloop() { else { state = DEAD_PAUSE; state_timeout = 50.0; - xship = 10; - yship = YSIZE/2; - xvel = 0; - yvel = 0; } }