-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
38 lines (31 loc) · 904 Bytes
/
Copy pathMain.py
File metadata and controls
38 lines (31 loc) · 904 Bytes
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
import player
import enemy
import cells
import time
running = True
#temp_px_pos = 0
#temp_py_pos = 0
def move():
if choice == 1:
player.px_pos -= 1
cells.create_chunk(player.px_pos, player.py_pos)
elif choice == 2:
player.px_pos += 1
cells.create_chunk(player.px_pos, player.py_pos)
elif choice == 3:
player.py_pos -= 1
cells.create_chunk(player.px_pos, player.py_pos)
elif choice == 4:
player.py_pos += 1
cells.create_chunk(player.px_pos, player.py_pos)
while running is True:
#temp_px_pos = player.px_pos
#temp_py_pos = player.py_pos
choice = int(input(f"You can do 6 things.\n\n1: move left.\n2: move right.\n3: move down.\n4: move up\n5: open inventory.\n6: save and quit")).strip
if 5 > choice < 0:
move()
print(f"You are now at {player.px_pos}, {player.py_pos}")
elif choice == 5:
player.inventory()
elif choice == 6:
break