X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=rocks.c;h=607431dada316ced97c294d36e27884985f77e97;hp=94df49954866645c95e4cb967f1a6e89a48b9abe;hb=04a50f75c62ca742bed40524cc242b605e68ace6;hpb=28d859440d40ee2d7d54500f4687e86168137cb8 diff --git a/rocks.c b/rocks.c index 94df499..607431d 100644 --- a/rocks.c +++ b/rocks.c @@ -25,6 +25,8 @@ struct shape rock_shapes[NROCKS]; // timers for rock generation. float rtimers[4]; +uint32_t rcnt; + uint32_t nrocks; uint32_t nrocks_timer; uint32_t nrocks_inc_ticks = 2*60*1000/(F_ROCKS-I_ROCKS); @@ -64,6 +66,7 @@ reset_rocks(void) for(i = 0; ix = rnd()*(XSIZE + rockptr->image->w); rockptr->y = YSIZE; - rockptr->dx = RDY*crnd(); + rockptr->dx = RDX*crnd(); rockptr->dy = -weighted_rnd_range(rmin[i], rmax[i]) + screendy; break; case TOP: rockptr->x = rnd()*(XSIZE + rockptr->image->w); rockptr->y = -rockptr->image->h; - rockptr->dx = RDY*crnd(); + rockptr->dx = RDX*crnd(); rockptr->dy = weighted_rnd_range(rmin[i], rmax[i]) + screendy; break; } rockptr->active = 1; + rcnt++; } } } @@ -224,9 +228,12 @@ move_rocks(void) 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(rcnt < nrocks) printf("-%d.\n", nrocks-rcnt); + // else printf("%d.\n", rcnt-nrocks); } void