From b12606899c98d7fc7a120c2b79797b5c45283ad2 Mon Sep 17 00:00:00 2001 From: zlago Date: Wed, 23 Oct 2024 19:17:26 +0200 Subject: hacky save system --- src/flier.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/flier.c') 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; -- cgit 1.4.1-2-gfad0