now the movement of the player is working properly well and being calculated based on the speed of the player

This commit is contained in:
Filipriec
2025-11-15 22:40:23 +01:00
parent de6facff03
commit 8cb6892d30
4 changed files with 42 additions and 7 deletions

View File

@@ -1,17 +1,15 @@
// src/render/background.cpp
#include "background.h"
#include "../assets/background_frame.h"
#include <cstdio>
#include <cstring>
void draw_mask(const char *unused_filename, int shift, const char *text) {
const int view_width = 90;
const int view_height = 16;
// Terminal clear + home
printf("\033[2J\033[H");
for (int i = 0; i < view_height && i < VIEW_HEIGHT; i++) {
for (int i = 0; i < VIEW_HEIGHT && i < VIEW_HEIGHT; i++) {
const char *row = BACKGROUND_MASK[i];
int width = strlen(row);
if (width == 0) {
@@ -21,7 +19,7 @@ void draw_mask(const char *unused_filename, int shift, const char *text) {
int start = shift % width;
for (int j = 0; j < view_width; j++) {
for (int j = 0; j < VIEW_WIDTH; j++) {
printf("%c", row[(start + j) % width]);
}
printf("\r\n");