summaryrefslogtreecommitdiff
path: root/tui/static.py
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-14 14:56:54 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-14 14:56:54 +0200
commit3dd13c9ed2fc57c525ddf0dd5c7d130229087a16 (patch)
tree3b3254fabd14253977cadf1fc4c4d736b311b92c /tui/static.py
parent2b98f7c66facfe71bf91aebc0d8cf3978e88303f (diff)
Making bomb and safe marking to actually do something.
Diffstat (limited to 'tui/static.py')
-rw-r--r--tui/static.py27
1 files changed, 22 insertions, 5 deletions
diff --git a/tui/static.py b/tui/static.py
index 7bdfa12..b594c44 100644
--- a/tui/static.py
+++ b/tui/static.py
@@ -9,7 +9,7 @@ class Action(Enum):
FLAG = 2 # Ruudun liputus
HINT = 3 # Anna vihjeet
AUTO = 4 # Pelaa automaattisesti
- LEFT = 5
+ LEFT = 5 # Liikkumiset...
RIGHT = 6
UP = 7
DOWN = 8
@@ -17,19 +17,36 @@ class Action(Enum):
BOTTOM = 10
BEGIN = 11
END = 12
- NOOP = 13
+ NOOP = 13 # ei mitään - tarvitaan, ettei mätsää ansikoodeja esciin
+ BOMB = 14 # merkkaa pommi
+ SAFE = 15 # merkkaa turvallinen
# ActionKeys - Ohjelma vertaa syötteen alkua näihin ja palauttaa ekan
ActionKeys = {
"\033[A": Action.UP, "\033[D": Action.LEFT,
"\033[C": Action.RIGHT, '\033[B': Action.DOWN, "\033[5~": Action.TOP,
"\033[6~": Action.BOTTOM, "\033[7~": Action.BEGIN,"\033[8~": Action.END,
- "\033[": Action.NOOP, "\033": Action.QUIT,
+ "\033[": Action.NOOP, "\033": Action.QUIT, "t": Action.SAFE,
"w": Action.UP, "a": Action.LEFT, "s": Action.DOWN,
"d": Action.RIGHT, " ": Action.OPEN, "\n": Action.OPEN,
"f": Action.FLAG, "m": Action.FLAG, "q": Action.QUIT,
+ "p": Action.BOMB, "x": Action.BOMB, "o": Action.SAFE,
+ "l": Action.QUIT,
}
+KEY_DESCRIPTIONS = """
+Liikkuminen:
+ YLÖS,ALAS,VASEN,OIKEA,PGDN,PGUP,HOME,END,w,a,s,d
+Merkitseminen:
+ m - merkitse
+ p,x - pommi
+ t,o - turvallinen
+Avaaminen:
+ ENTER, SPACE
+Lopetus:
+ l,q,ESC
+"""
+
@dataclass
class TileType:
""" ruututyyppien tallennusmuotojen kuvaus"""
@@ -49,7 +66,7 @@ TileTypes = {
8: TileType( "[8]", [(0x9,0), (0x9,0), (0x9,0)] ),
9: TileType( "[@]", [(0xF,1), (0xF,1), (0xF,1)] ),
10: TileType( "[#]", [(0x8,7), (0x8,7), (0x8,7)] ),
- 11: TileType( "[B]", [(0x8,7), (0x1,7), (0x8,7)] ),
- 12: TileType( "[ ]", [(0x8,7), (0x3,7), (0x8,7)] ),
+ 11: TileType( "[×]", [(0x8,7), (0x1,7), (0x8,7)] ),
+ 12: TileType( "[•]", [(0x8,7), (0x2,7), (0x8,7)] ),
13: TileType( "[?]", [(0x8,7), (0x0,7), (0x8,7)] )
}