forked from spitsfire/adadachi-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.py
47 lines (39 loc) · 1.22 KB
/
game.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
from player import Player
from adadachi import Adadachi
from constants import *
import random
player = Player()
def display(statement):
print(statement)
def create_adadachi():
name = input(GET_NAME + "\n\t")
foods = player.inventory["foods"]
games = player.inventory["games"]
personality = {
"fav_food": random.randint(0,len(foods)),
"fav_game": random.randint(0,len(games)),
"hates_food": random.randint(0,len(foods)),
"hates_game": random.randint(0,len(games)),
}
player.adadachi = Adadachi(name,personality)
def start_game():
display(TITLE)
answer = input(GREETING)
if answer.lower() == "y":
create_adadachi()
while player.adadachi.hunger < 5:
option = input(OPTIONS).lower()
if option == "s":
player.get_status()
elif option == "c":
player.clean()
elif option == "f":
if player.inventory["foods"]:
player.feed()
else:
break
elif option == "p":
player.play_with_adadachi()
elif option == "x":
return display(EXIT)
display(LOST)