From: Joshua Grams Date: Thu, 28 Apr 2005 23:50:38 +0000 (+0000) Subject: added constant MAX_DUST_DEPTHS. X-Git-Tag: 0.3~13 X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=commitdiff_plain;h=511783c655d6fdcc22509b09ec1afbfba21299e3 added constant MAX_DUST_DEPTHS. put ship back in center of screen at start. explosion now in same place as ship. --- diff --git a/config.h b/config.h index 62ba253..62b9fda 100644 --- a/config.h +++ b/config.h @@ -27,6 +27,7 @@ #define MAXENGINEDOTS 5000 #define MAXBANGDOTS 50000 #define MAXSPACEDOTS 2000 +#define MAXDUSTDEPTH 2 #define W 100 #define M 255 #define BLAST_RADIUS 300 // radius^2 (pixels) which will be cleared of rocks when you die diff --git a/main.c b/main.c index 6b575bd..3fbe7a6 100644 --- a/main.c +++ b/main.c @@ -132,8 +132,8 @@ init_space_dots() { for(i = 0; iformat, b, b, b); } } @@ -753,12 +753,13 @@ gameloop() { if(shipx<0 || shipx>XSIZE-surf_ship->w) { // BOUNCE from left and right wall shipx -= shipdx*gamerate; - shipdx *= -0.99; + shipdx *= -99; } // BOUNCE Y if(shipy<0 || shipy>YSIZE-surf_ship->h) { // BOUNCE from top and bottom wall + printf("bouncing top/bottom.\n"); shipy -= shipdy; shipdy *= -0.99; } @@ -768,7 +769,7 @@ gameloop() { // Play the explosion sound play_sound(0); make_bang_dots(shipx,shipy,shipdx,shipdy,surf_ship,30); - shipdx = screendx; + shipdx = 0; shipdy = 0; if(--nships <= 0) { gameover = 1; @@ -797,9 +798,9 @@ gameloop() { play_tune(1); gameover = 0; - shipx = 2*XSIZE/3; + shipx = XSIZE/2; shipy = YSIZE/2; - shipdx = screendx; + shipdx = 0; shipdy = 0; } diff --git a/rocks.c b/rocks.c index 5653979..5c23b81 100644 --- a/rocks.c +++ b/rocks.c @@ -229,7 +229,7 @@ blast_rocks(float x, float y, float radius, int onlyslow) n = sqrt(dx*dx + dy*dy); if(n < radius) { n *= 20; - rock[i].dx += 54.0*(dx+30)/n; + rock[i].dx += 54.0*dx/n; rock[i].dy += 54.0*dy/n; } }