JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
bump version to 0.5.8
[vor.git] / rocks.c
diff --git a/rocks.c b/rocks.c
index 5f637e0..ff8f8f9 100644 (file)
--- a/rocks.c
+++ b/rocks.c
@@ -4,7 +4,7 @@
 #include <string.h>
 
 #include "common.h"
-#include "config.h"
+#include "vorconfig.h"
 #include "file.h"
 #include "globals.h"
 #include "mt.h"
@@ -37,7 +37,7 @@ reset_rocks(void)
        nrocks_timer = 0;
 }
 
-#define ROCK_LEN sizeof("sprites/rockXX.png")
+#define ROCK_LEN sizeof("rockXX.png")
 
 void
 load_rocks(void)
@@ -46,7 +46,7 @@ load_rocks(void)
        char a[ROCK_LEN];
 
        for(i=0; i<NROCKS; i++) {
-               snprintf(a, ROCK_LEN, "sprites/rock%02d.png", i);
+               snprintf(a, ROCK_LEN, "rock%02d.png", i);
                load_sprite(SPRITE(&prototypes[i]), a);
                prototypes[i].sprite_type = ROCK;
                prototypes[i].flags = MOVE|DRAW|COLLIDE;
@@ -159,6 +159,7 @@ new_rocks(void)
                        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(void)
                                        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();