Update terminis.py

This commit is contained in:
adrienmalin 2019-02-07 22:37:52 +01:00 committed by GitHub
parent e92032542d
commit 2839995d79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,7 +12,9 @@ import random
import sched
import time
# You can change controls here.
# Acceptable values are printable keys ('q', 'w'...) and curses's constants name starting with "KEY_"
# See https://docs.python.org/3/library/curses.html?highlight=curses#constants
CONTROLS = {
"MOVE LEFT": "KEY_LEFT",
"MOVE RIGHT": "KEY_RIGHT",
@ -26,7 +28,6 @@ CONTROLS = {
}
FILE = ".terminis"
@ -600,11 +601,11 @@ class Game:
self.next.refresh(paused=True)
self.scr.nodelay(False)
while True:
key = self.scr.getch()
if key == ord('q'):
key = self.scr.getkey()
if key == CONTROLS["QUIT"]:
self.playing = False
break
elif key == ord('p'):
elif key == CONTROLS["PAUSE"]:
self.scr.nodelay(True)
self.hold.refresh()
self.matrix.refresh()
@ -661,4 +662,4 @@ def main():
if __name__ == "__main__":
main()
main()