-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAction.py
47 lines (39 loc) · 866 Bytes
/
Action.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Key Cave Adventure Game
""" Initialization """
GAME_LEVELS = {
# dungeon layout: max moves allowed
"game1.txt": 7,
"game2.txt": 12,
"game3.txt": 19,
}
PLAYER = "O"
KEY = "K"
DOOR = "D"
WALL = "#"
MOVE_INCREASE = "M"
SPACE = " "
DIRECTIONS = {
"w": (-1, 0),
"s": (1, 0),
"d": (0, 1),
"a": (0, -1)
}
INVESTIGATE = "I"
QUIT = "Q"
VALID_ACTIONS = [INVESTIGATE, QUIT, *DIRECTIONS.keys()]
INVALID = "That's invalid."
WIN_TEXT = "You have won the game with your strength and honour!"
LOSE_TEST = "You have lost all your strength and honour."
""" Import the packages """
import tkinter as tk
import time
from PIL import ImageTk, Image
from tkinter import messagebox
from tkinter import filedialog
''' Put the main here'''
def main():
root = tk.Tk()
GameApp(root)
root.mainloop()
if __name__ == "__main__":
main()