78 lines
1.8 KiB
Python
Raw Normal View History

2021-05-11 10:34:56 -04:00
import obj
import tools
2021-05-10 16:14:23 -04:00
def titleScreen():
2021-05-10 16:14:23 -04:00
while(True):
2021-05-11 10:34:56 -04:00
tools.clearScreen()
print("Space Game Title To Be Disclosed!!!")
2021-05-10 19:27:43 -04:00
userInput = input("(n)ew game\n(q)uit:\n>> ").lower()
2021-05-10 16:14:23 -04:00
if userInput == "q":
break
if userInput == "n":
mainGame()
def mainGame():
2021-05-11 10:34:56 -04:00
tools.clearScreen()
tradeableItems = [
obj.Item("flour", 0.5),
obj.Item("Rice Cakes", 1),
obj.Item("Water", 25)
]
#Create TradeHubs
tradeHubs = {
2021-05-11 10:34:56 -04:00
"The Jackel" : obj.TradeHub("The Jackel"),
"Star Crapper" : obj.TradeHub("Star Crapper")
}
tradeHubs["The Jackel"].addItems(tradeableItems)
tradeableItems.pop()
tradeHubs["Star Crapper"].addItems(tradeableItems)
# Create Planets
planets = {
2021-05-11 10:34:56 -04:00
"BoB" : obj.Planet("BoB"),
"Luna" : obj.Planet("Luna")
}
planets["BoB"].addTradeHub(tradeHubs["Star Crapper"])
2021-05-10 19:13:26 -04:00
planets["Luna"].addTradeHub(tradeHubs["The Jackel"])
# Create user
2021-05-10 16:14:23 -04:00
userInput = ""
userInput = input("What is your name... peasant?\n>> ")
if userInput == "":
userInput = "(none)"
# Start Game
2021-05-11 10:34:56 -04:00
Game = obj.GameManager(userInput, planets)
2021-05-10 16:14:23 -04:00
2021-05-11 10:34:56 -04:00
tools.clearScreen()
2021-05-10 16:14:23 -04:00
while Game.isGameRunning():
2021-05-10 19:27:43 -04:00
userInput = ""
userInput = input("(q)uit\n\n(p)layer stats\n(e)nter trade hub\n(c)lear screen:\n>> ").lower()
2021-05-10 16:14:23 -04:00
if userInput == "q":
Game.stopGame()
2021-05-10 19:27:43 -04:00
elif userInput == "p":
2021-05-10 16:14:23 -04:00
Game.printPlayerStats()
2021-05-10 19:27:43 -04:00
elif userInput == "c":
2021-05-11 10:34:56 -04:00
tools.clearScreen()
2021-05-10 19:27:43 -04:00
elif userInput == "e":
Game.enterTradeHub()
2021-05-10 19:27:43 -04:00
else:
2021-05-11 10:34:56 -04:00
tools.clearScreen()
2021-05-10 16:14:23 -04:00
def main():
titleScreen()
2021-05-10 16:14:23 -04:00
main()