JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
renamed *_SPRITE to *, made rocks bounce off each other.
[vor.git] / main.c
diff --git a/main.c b/main.c
index 097969c..880f14e 100644 (file)
--- a/main.c
+++ b/main.c
@@ -66,7 +66,7 @@ struct bangdots bdot[MAXBANGDOTS], *bdotptr = bdot;
 char topline[1024];
 char *initerror = "";
 
-struct ship ship = { SHIP_SPRITE, NULL, XSIZE/2, YSIZE/2, SCREENDXMIN, 0.0 };
+struct ship ship = { SHIP, NULL, XSIZE/2, YSIZE/2, SCREENDXMIN, 0.0 };
          
 float screendx = SCREENDXMIN, screendy = 0.0;
 float xscroll, yscroll;
@@ -510,7 +510,11 @@ draw() {
        }
 
        if(state == GAMEPLAY) {
-               bang = collides(SPRITE(&ship));
+               Sprite *r = collides(SPRITE(&ship));
+               if(r) {
+                       bounce(r, SPRITE(&ship));
+               }
+               collisions();
        }
 
        ms_frame = SDL_GetTicks() - ms_end;
@@ -532,6 +536,12 @@ draw() {
        return bang;
 }
 
+void
+do_collision(Sprite *a, Sprite *b)
+{
+       bounce(a, b);
+}
+
 int
 gameloop() {
        Uint8 *keystate = SDL_GetKeyState(NULL);