]> git.lizzy.rs Git - dungeon_game.git/blobdiff - plugins/healthbar/healthbar.c
Center healthbar
[dungeon_game.git] / plugins / healthbar / healthbar.c
index 5651051b4b572dd5b8dc9019481475469f503d08..c66d3f13c2333093d1c61efd649b63f2f566f95a 100644 (file)
@@ -7,7 +7,7 @@ static struct color gray;
 static void render_healthbar(struct winsize ws)
 {
        int y = max(ws.ws_row - 2, 0);
-       int x = max(ws.ws_col / 2 - player.max_health, 0);
+       int x = max(ws.ws_col / 2 - player.max_health / 2, 0);
 
        printf("\e[%u;%uH", y, x);