80 lines
1.8 KiB
Python

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