pvjc24/final/world.c

36 lines
459 B
C
Raw Permalink Normal View History

2024-05-15 11:21:54 +00:00
#include <ncurses.h>
#include "world.h"
static int width, height;
void init_world(int w, int h) {
width = w;
height = h;
initscr();
noecho();
curs_set(FALSE);
timeout(100);
keypad(stdscr, TRUE);
}
void clear_world() {
clear();
}
void draw_character(char c, int x, int y) {
mvaddch(y, x, c);
}
void refresh_world() {
refresh();
}
int world_width() {
return width;
}
int world_height() {
return height;
}