diff --git a/src/linux.h b/src/arch/linux.h similarity index 100% rename from src/linux.h rename to src/arch/linux.h diff --git a/src/arch/universal.h b/src/arch/universal.h new file mode 100644 index 0000000..a4b6524 --- /dev/null +++ b/src/arch/universal.h @@ -0,0 +1,21 @@ +//TODO these header files should be split into 2 files file.c and file.h +//file.h will just contain the decleration and file.c will contain the code + +//TODO This file should have time aswell +#include + +int zom_scrinit(void) { + puts("\e[2J"); + return 0; +} +int zom_screxit(void) { + return 0; +} +int zom_putcharat(int x, int y, char chara) { + mvaddch(y, x, chara); //flipped to match screen coords + printf("\e[%d;%dH%c", y, x, chara); + return 0; +} +char zom_getch(void) { + return getch(); +} diff --git a/src/main.c b/src/main.c index 95d80f1..f33f6d7 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,6 @@ #include //printf and shit #include -#include "linux.h" //TODO make this detect and change depending on os +#include "arch/linux.h" //TODO make this detect and change depending on os #include "maptest.h" #include "map.h" //###################################################### @@ -77,9 +77,6 @@ int main( int argc, char *argv[] ) { //yoinked from the internet argc is number prevtime = clock(); int delay = 1000; int dosspin = 0; - - //TODO nuke bools they arnt part of the c99 standard - //here it js being stolen from curses int gamerun = 1; @@ -145,6 +142,7 @@ int main( int argc, char *argv[] ) { //yoinked from the internet argc is number if ((clock() % 100) == 1) { if (enemy.x > player.x) { enemy.x--; + attempt_move(&player, 1, 0); } else {enemy.x++;} if (enemy.y > player.y) { enemy.y--;