player rendered

This commit is contained in:
Priec
2025-11-14 12:35:22 +01:00
parent ebe03f42b6
commit 13f01d13f8
5 changed files with 109 additions and 569 deletions

View File

@@ -0,0 +1,19 @@
// src/render/player.cpp
#include "player.h"
#include "player_mask.h"
#include <cstdio>
void draw_player(int view_width, int view_height) {
const int sprite_height = PLAYER_MASK_LINES;
const int sprite_width = 3; // all rows are same width (3 chars)
int center_x = view_width / 2 - sprite_width / 2;
int center_y = view_height / 2 - sprite_height / 2;
for (int i = 0; i < sprite_height; i++) {
printf("\033[%d;%dH%s", center_y + i + 1, center_x + 1, PLAYER_MASK[i]);
}
fflush(stdout);
}