fixed absurd amount of decimals in check on cat, fixed desktop loading saves (oops, it broke in past commits), and load error and success message for desktop
This commit is contained in:
11
game.py
11
game.py
@@ -120,7 +120,16 @@ class Game:
|
|||||||
save = "saves/" + ui.select(
|
save = "saves/" + ui.select(
|
||||||
"Please choose a savefile to load", os.listdir("saves")
|
"Please choose a savefile to load", os.listdir("saves")
|
||||||
)
|
)
|
||||||
self.cat = data.save.load(save)
|
try:
|
||||||
|
self.cat = data.save.load(save)
|
||||||
|
except:
|
||||||
|
print("The savefile you selected was unable to load, it may be corrupt.")
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
print(
|
||||||
|
f"Savefile loaded successfully! Continuing save with {self.cat.name}."
|
||||||
|
)
|
||||||
|
return True
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
title()
|
title()
|
||||||
|
|||||||
@@ -185,8 +185,8 @@ def house(cat: Cat):
|
|||||||
print(
|
print(
|
||||||
f"{cat.name} - a {cat.traits["size"]} {cat.traits["color"]} with {cat.traits["eyes"]} eyes."
|
f"{cat.name} - a {cat.traits["size"]} {cat.traits["color"]} with {cat.traits["eyes"]} eyes."
|
||||||
)
|
)
|
||||||
print(f"Happiness level: {cat.happiness}")
|
print(f"Happiness level: {round(cat.happiness,1)}")
|
||||||
print(f"Fullness: {cat.fullness}/100")
|
print(f"Fullness: {round(cat.fullness,1)}/100")
|
||||||
print(f"You have ${cat.money}.")
|
print(f"You have ${cat.money}.")
|
||||||
case "Pet your cat":
|
case "Pet your cat":
|
||||||
pet(cat)
|
pet(cat)
|
||||||
|
|||||||
Reference in New Issue
Block a user