summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..d6b26ea
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,38 @@
+#include "main.hpp"
+
+int main()
+{
+ Screen s;
+
+ //Frame map(2*s.getHeight(),2*s.getWidth(),0,0);
+ Frame map("../scripts/map",0,0);
+ Frame view(map,s.getHeight(),s.getWidth(),0,0);
+
+ Character cursor('X',map.getHeight()/2,map.getWidth()/2);
+
+ map.fillWindow();
+ map.add(cursor);
+ view.center(cursor);
+ view.refresh();
+
+ while(true)
+ {
+ char c = getch();
+
+ if(c == 'h')
+ map.add(cursor,cursor.getRow(),cursor.getCol()-1);
+ else if(c == 'l')
+ map.add(cursor,cursor.getRow(),cursor.getCol()+1);
+ else if(c == 'k')
+ map.add(cursor,cursor.getRow()-1,cursor.getCol());
+ else if(c == 'j')
+ map.add(cursor,cursor.getRow()+1,cursor.getCol());
+ else if(c == 'q')
+ break;
+
+ view.center(cursor);
+ view.refresh();
+ }
+
+ return 0;
+}