diff --git a/a.out b/a.out index 6566a38..bd3c0db 100755 Binary files a/a.out and b/a.out differ diff --git a/characters.png b/characters.png new file mode 100644 index 0000000..0835bce Binary files /dev/null and b/characters.png differ diff --git a/main.cpp b/main.cpp index 0147c58..6b700eb 100644 --- a/main.cpp +++ b/main.cpp @@ -5,13 +5,15 @@ using namespace std; int main() { terminal_open(); - terminal_set("window: size=40x20, title='Terminal Trainers'"); + terminal_set("window: size=225x65, title='Terminal Trainers'"); - int x = 10; - int y = 10; - int mapHeight = 20; - int mapLength = 40; + + int x = 20; + int y = 20; + + int mapHeight = 100; + int mapLength = 100; int mapSize = mapHeight * mapLength; char map[mapSize + mapHeight]; @@ -39,21 +41,44 @@ int main() { bool running = true; + terminal_refresh(); + + terminal_set("0xE000: characters.png, size=16x16, spacing=0x0, resize=32x32, transparent=#EBEBEB"); + + terminal_put(x, y, 0xE001); while (running) { + terminal_refresh(); terminal_clear(); - terminal_print_ext(0, 0, 40, 20, TK_ALIGN_LEFT, map); - terminal_put(x, y, 0x20AC); - terminal_refresh(); + //terminal_print_ext(0, 0, mapLength, mapHeight, TK_ALIGN_LEFT, map); + // terminal_put(x, y, 0x20AC); + + //terminal_put(x, y, 0xE000); int key = terminal_read(); - if (key == TK_ESCAPE) running = false; - else if (key == TK_UP || key == TK_W) y--; - else if (key == TK_DOWN || key == TK_S) y++; - else if (key == TK_LEFT || key == TK_A) x--; - else if (key == TK_RIGHT || key == TK_D) x++; + if (key == TK_ESCAPE) { + running = false; + }else if (key == TK_UP || key == TK_W) { + y--; + + terminal_put(x, y, 0xE001); + terminal_refresh(); + }else if (key == TK_DOWN || key == TK_S) { + y++; + + terminal_put(x, y, 0xE000); + terminal_refresh(); + }else if (key == TK_LEFT || key == TK_A) { + x--; + + terminal_put(x, y, 0xE002); + }else if (key == TK_RIGHT || key == TK_D) { + x++; + + terminal_put(x, y, 0xE002); + } } terminal_close();