Comments on centering text

This commit is contained in:
Night Kaly 2024-10-05 22:01:34 +01:00
parent 84df2eaefa
commit 4a65138a77
Signed by: night0721
GPG key ID: 957D67B8DB7A119B

View file

@ -172,7 +172,8 @@ void print_world()
} }
printf("\n"); printf("\n");
} }
printf("\033[2K\033[%dC" HEART " : %d " SKULL " : %d " INVENTORY " : %d\n", world.max_x / 2 - 8, player.health, player.kills, player.inventory[player.slot - 1].count); /* Center text depending on length */
printf("\033[2K\033[%dC" HEART " : %d " SKULL " : %d " INVENTORY " : %d\n", world.max_x / 2 - 13, player.health, player.kills, player.inventory[player.slot - 1].count);
printf("\033[2K\033[%dC%s\n", world.max_x / 2 - strlen(statusline) / 2, statusline); printf("\033[2K\033[%dC%s\n", world.max_x / 2 - strlen(statusline) / 2, statusline);
print_icon_boxes(); print_icon_boxes();
fflush(stdout); fflush(stdout);