diff options
Diffstat (limited to 'src/flier.c')
-rw-r--r-- | src/flier.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/flier.c b/src/flier.c index bfce46a..f51a8a1 100644 --- a/src/flier.c +++ b/src/flier.c @@ -89,7 +89,12 @@ static int bullet_update(struct projectile *self) { } static int bullet_draw(struct projectile *self, int camX, int camY) { - SDL_Rect rect = {4, 0, 4, 4}; + SDL_Rect rect; + if (self->hp & 0x2) { + rect = (SDL_Rect) {4, 0, 4, 4}; + } else { + rect = (SDL_Rect) {12, 0, 4, 4}; + } SDL_RenderCopy(renderer, self->texture, &rect, &(SDL_Rect) {from_fixed(self->x) - camX - 1, from_fixed(self->y) - camY - 1, 4, 4}); SDL_RenderCopy(renderer, self->texture, &rect, &(SDL_Rect) {from_fixed(self->x - self->velocity.x) - camX - 1, from_fixed(self->y - self->velocity.y) - camY - 1, 4, 4}); return 0; |