summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authortom <tom@ground-control>2015-11-19 11:30:19 -0600
committertom <tom@ground-control>2015-11-19 11:30:19 -0600
commitdea2c1d5a08812dc056088ce77ec6483467f9ac5 (patch)
treec6436aa1d36dd8ee6244971a8764501a3fec7989 /src/main.cpp
parent0a5607011a5720d83612636da6c7e935c1b82c50 (diff)
now in technicolor
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9dc48a4..5c550de 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3,35 +3,35 @@
int main()
{
Screen s;
-
- //Frame map(2*s.getHeight(),2*s.getWidth(),0,0);
+
Frame map("scripts/map.txt",0,0);
Frame view(map,s.getHeight(),s.getWidth(),0,0);
Character cursor('X',map.getHeight()/2,map.getWidth()/2);
-
- map.fillWindow();
+
+ map.fillWindow();
map.add(cursor);
view.center(cursor);
- view.refresh();
-
+ view.refresh();
+
while(true)
{
- char c = getch();
+ 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;
- 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();
+ map.fillWindow();
}
return 0;