JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added area back to get_shape, bounce() uses area.
[vor.git] / sprite.h
index 4c0cefd..e1216cf 100644 (file)
--- a/sprite.h
+++ b/sprite.h
@@ -22,6 +22,7 @@ struct sprite {
        int w, h;
        int mask_w;
        uint32_t *mask;
+       uint32_t area;
 };
 
 Sprite *free_sprites[N_TYPES];  // lists of free sprites, by type.
@@ -31,10 +32,12 @@ void add_sprite(Sprite *s);
 void move_sprite(Sprite *s);
 void move_sprites(void);
 
-int collides(Sprite *s);
+Sprite *collides(Sprite *s);
 int pixel_collides(float x, float y);
 void load_sprite(Sprite *sprite, char *filename);
 
+void bounce(Sprite *a, Sprite *b);
+
 
 // extended sprites
 
@@ -48,6 +51,7 @@ struct ship {
        int w, h;
        int mask_w;
        uint32_t *mask;
+       uint32_t area;
        // SHIP extras
        int lives;
        int jets;
@@ -63,6 +67,7 @@ struct rock {
        int w, h;
        int mask_w;
        uint32_t *mask;
+       uint32_t area;
        // ROCK extras
        int type;
 };