working server and gameloop

This commit is contained in:
2026-04-26 13:44:54 -04:00
parent 81488417d9
commit 3607c4bf36
8 changed files with 194 additions and 116 deletions

38
term.c Normal file
View File

@@ -0,0 +1,38 @@
#include "game.h"
#include <curses.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void SetupTermWin()
{
srand(getpid());
// Setup Terminal
if (initscr() == NULL) {
perror("initscr failed");
exit(1);
}
noecho();
cbreak();
nodelay(stdscr, TRUE);
}
void CloseTermWin()
{
endwin();
}
void GameAlert(char* str)
{
MGameAlert(0,0,str);
}
void MGameAlert(int y, int x, char* str)
{
move(y, x);
clrtoeol();
mvaddstr(y, x, str);
refresh();
}