From: Joshua Grams Date: Mon, 13 Dec 2004 20:26:08 +0000 (+0000) Subject: first try at blasting the rocks out of the way X-Git-Tag: 0.1~37 X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=commitdiff_plain;h=5abd974b9e8aee28979e797d52eb5a71dd8b10ff first try at blasting the rocks out of the way --- diff --git a/config.h b/config.h index 63d143b..d8991ef 100644 --- a/config.h +++ b/config.h @@ -18,4 +18,4 @@ #define MAXSPACEDOTS 2000 #define W 100 #define M 255 -#define START_RAD_SQ 40000 // radius^2 (pixels) which will be cleared of rocks when you die +#define START_RAD 200 // radius^2 (pixels) which will be cleared of rocks when you die 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; } }