X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=rocks.c;h=ff8f8f96a1a0aaa9f89bf04539b745e9f00fae31;hp=c404305dbc52d7d39b9d26b31399a62ef5f6442c;hb=af493c1e4799e44c262357a9d34ca9f583466acd;hpb=51d56bfe5830a41e61f4ceefb75217f647d994fe diff --git a/rocks.c b/rocks.c index c404305..ff8f8f9 100644 --- a/rocks.c +++ b/rocks.c @@ -4,7 +4,7 @@ #include #include "common.h" -#include "config.h" +#include "vorconfig.h" #include "file.h" #include "globals.h" #include "mt.h" @@ -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++) { @@ -159,6 +159,7 @@ new_rocks(float ticks) type = urnd() % NROCKS; *r = prototypes[type]; r->type = type; + r->life = r->area * 300; switch(i) { case RIGHT: r->x = XSIZE; @@ -175,14 +176,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();