summary refs log tree commit diff
path: root/src/flier.c
diff options
context:
space:
mode:
authorzlago2024-10-23 19:17:26 +0200
committerzlago2024-10-23 19:17:26 +0200
commitb12606899c98d7fc7a120c2b79797b5c45283ad2 (patch)
treef210a037fee0f2346bae8a10d1edc1b445b4324f /src/flier.c
parentaf6acead62498bc49065ef828e388bcd511ce54d (diff)
hacky save system
Diffstat (limited to 'src/flier.c')
-rw-r--r--src/flier.c7
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;