X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=rocks.c;h=7c43427eff15cf7e3f6c1514e63fa78433e1680e;hp=c404305dbc52d7d39b9d26b31399a62ef5f6442c;hb=38c7d9db0b40a72ac6b7c613eed05f20ea49d3c0;hpb=51d56bfe5830a41e61f4ceefb75217f647d994fe diff --git a/rocks.c b/rocks.c index c404305..7c43427 100644 --- a/rocks.c +++ b/rocks.c @@ -129,7 +129,7 @@ weighted_rnd_range(float min, float max) { } void -new_rocks(float ticks) +new_rocks(void) { int i, type; struct rock *r; @@ -138,7 +138,7 @@ new_rocks(float ticks) float rmax[4]; if(nrocks < final_rocks) { - nrocks_timer += ticks; + nrocks_timer += t_frame; if(nrocks_timer >= nrocks_inc_ticks) { nrocks_timer -= nrocks_inc_ticks; nrocks++; @@ -148,7 +148,7 @@ new_rocks(float ticks) rock_sides(ti, rmin, rmax); // increment timers - for(i=0; i<4; i++) rtimers[i] += ti[i]*ticks; + for(i=0; i<4; i++) rtimers[i] += ti[i]*t_frame; // generate rocks for(i=0; i<4; i++) { @@ -175,14 +175,14 @@ new_rocks(float ticks) r->dy = RDY*crnd(); break; case BOTTOM: - r->x = frnd()*(XSIZE + r->image->w); + r->x = (frnd()*(XSIZE + r->image->w)) - r->image->w; r->y = YSIZE; r->dx = RDX*crnd(); r->dy = -weighted_rnd_range(rmin[i], rmax[i]) + screendy; break; case TOP: - r->x = frnd()*(XSIZE + r->image->w); + r->x = (frnd() * (XSIZE + r->image->w)) - r->image->w; r->y = -r->image->h; r->dx = RDX*crnd();