Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions game.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ def use_oxygen(self):
# Oxygen limit: 100; cannot use oxygen if supply is below 10 and print appropriate message
pass

def collect_gold(self, amount):
# Collects gold and increment amount with appropriate message
pass
def collect_gold(self, amount):
# Collects gold and increment amount with appropriate message
if amount <= 0:
print("No gold collected.")
return 0

self.gold += amount
print(f"You collected {amount} gold. Total gold: {self.gold}")
return amount

class Alien:
def __init__(self, name, health, attack):
Expand Down