X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=rocks.c;h=03f8671804bdb6ebe44f4804b06fe9e75ea158a2;hp=59b401646797afd0b39668c6d31b3244e0390821;hb=e0fab1bd78914a12ee88f2a9fcfca9f28a1df0f2;hpb=d2c7edfd9f15b74baba78b935b555f351b93728c diff --git a/rocks.c b/rocks.c index 59b4016..03f8671 100644 --- a/rocks.c +++ b/rocks.c @@ -3,6 +3,7 @@ #include #include +#include "common.h" #include "config.h" #include "file.h" #include "globals.h" @@ -25,10 +26,6 @@ struct shape rock_shapes[NROCKS]; // timers for rock generation. float rtimers[4]; -int32_t rcnt, lrcnt; -int32_t rsum, rsamples; -float ravg; - uint32_t nrocks; uint32_t nrocks_timer; uint32_t nrocks_inc_ticks = 2*60*1000/(F_ROCKS-I_ROCKS); @@ -68,14 +65,12 @@ reset_rocks(void) for(i = 0; i= 1) { rtimers[i] -= 1; j=0; @@ -210,7 +201,6 @@ new_rocks(void) } rockptr->active = 1; - rcnt++; } } } @@ -225,25 +215,15 @@ move_rocks(void) for(i = 0; i < MAXROCKS; i++) { if(rock[i].active) { // move - rock[i].x += (rock[i].dx-screendx)*gamerate; - rock[i].y += (rock[i].dy-screendy)*gamerate; + rock[i].x += (rock[i].dx-screendx)*framelen; + rock[i].y += (rock[i].dy-screendy)*framelen; // clip if(rock[i].x < -rock[i].image->w || rock[i].x >= XSIZE || rock[i].y < -rock[i].image->h || rock[i].y >= YSIZE) { rock[i].active = 0; - rcnt--; } } } - /* - if(lrcnt == -1 && rcnt == nrocks) lrcnt = 0; - if(rcnt != lrcnt && lrcnt != -1) { - lrcnt = rcnt; - rsum += rcnt-nrocks; rsamples++; - ravg = (float) rsum / rsamples; - printf("%.2f%%\n", 100.0 * ravg / nrocks); - } - */ } void