JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
now deleting dots which hit rocks.
[vor.git] / rocks.c
diff --git a/rocks.c b/rocks.c
index e7f2161..bee1ca5 100644 (file)
--- a/rocks.c
+++ b/rocks.c
@@ -261,6 +261,22 @@ hit_rocks(float x, float y, struct shape *shape)
        return 0;
 }
 
        return 0;
 }
 
+int
+pixel_hit_rocks(float x, float y)
+{
+       int i;
+       float xoff, yoff;
+
+       for(i=0; i<MAXROCKS; i++) {
+               if(rock[i].active) {
+                       xoff = x - rock[i].x; if(xoff < 0) continue;
+                       yoff = y - rock[i].y; if(yoff < 0) continue;
+                       if(pixel_collide(xoff, yoff, rock[i].shape)) return 1;
+               }
+       }
+       return 0;
+}
+
 void
 blast_rocks(float x, float y, float radius, int onlyslow)
 {
 void
 blast_rocks(float x, float y, float radius, int onlyslow)
 {