Back to main page
summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/main.py b/main.py
index f28c7ae..210d96c 100644
--- a/main.py
+++ b/main.py
@@ -2,14 +2,14 @@ import curses
import math
import random
-# h a
-key_left = [104, 97]
+# h a left
+key_left = [104, 97, 68]
# l d
-key_right = [108, 100]
+key_right = [108, 100, 67]
# j s
-key_down = [106, 115]
+key_down = [106, 115, 66]
# k w
-key_up = [107, 119]
+key_up = [107, 119, 65]
maxX = 4
@@ -33,14 +33,14 @@ def DrawSquare(x, y, val):
stdscr.addstr(y + 2, x, "+" + "-" * (scaleX - 2) + "+")
-def FullDraw():
+def FullDraw(key):
stdscr.clear()
- stdscr.addstr(maxY * scaleY, maxX * scaleX, "+")
for i in range(maxY):
for j in range(maxX):
if gamestate[i][j] == 0:
continue
DrawSquare(j * scaleX, i * scaleY, gamestate[i][j])
+ stdscr.addstr(maxY * scaleY, maxX * scaleX, "+")
# PROCESSING
@@ -154,8 +154,9 @@ def SpawnBlock():
# Init
stdscr = curses.initscr()
curses.noecho()
+userin = 0
while True:
- FullDraw()
+ FullDraw(userin)
userin = stdscr.getch()
if userin == 81: # Q
break