Back to main page
summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py63
1 files changed, 63 insertions, 0 deletions
diff --git a/main.py b/main.py
new file mode 100644
index 0000000..75e4204
--- /dev/null
+++ b/main.py
@@ -0,0 +1,63 @@
+import curses
+
+key_left = ['h', 'a']
+key_right = ['l', 'd']
+key_down = ['j', 's']
+key_up = ['k', 'w']
+
+
+maxX = 4
+maxY = 4
+
+gamestate = [[0 for mx in range(maxX)] for my in range(maxY)]
+
+gamestate[2][2] = 1
+gamestate[1][2] = 1
+gamestate[3][2] = 1
+
+def DrawSquare(x, y, val):
+ stdscr.addstr(y, x, "+")
+
+def FullDraw():
+ for i in range(maxY):
+ for j in range(maxX):
+ if gamestate[i][j] == 0:
+ continue
+ DrawSquare(j * 5, i * 3, gamestate[i][j])
+
+def MoveLeft():
+ pass
+
+def MoveRight():
+ pass
+
+def MoveDown():
+ pass
+
+def MoveUp():
+ pass
+
+
+
+# Init
+stdscr = curses.initscr()
+stdscr.noecho()
+while True:
+ FullDraw()
+ userin = stdscr.getch()
+ if userin == 'q':
+ break
+ if userin in key_left:
+ MoveLeft()
+ elif userin in key_right:
+ MoveRight()
+ elif userin in key_down:
+ MoveDown()
+ elif userin in key_up:
+ MoveUp()
+
+
+
+
+curses.endwin()
+