2021-05-11 10:34:56 -04:00
|
|
|
import obj
|
|
|
|
import tools
|
2021-05-10 16:14:23 -04:00
|
|
|
|
2021-05-10 16:25:51 -04:00
|
|
|
def titleScreen():
|
2021-05-10 16:14:23 -04:00
|
|
|
while(True):
|
2021-05-11 10:34:56 -04:00
|
|
|
tools.clearScreen()
|
2021-05-10 16:25:51 -04:00
|
|
|
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()
|
2021-05-11 18:35:04 -04:00
|
|
|
#load items
|
2021-05-11 16:29:45 -04:00
|
|
|
tradeableItems = [
|
|
|
|
obj.Item("flour", 0.5),
|
|
|
|
obj.Item("Rice Cakes", 1),
|
|
|
|
obj.Item("Water", 25)
|
|
|
|
]
|
2021-05-10 18:17:34 -04:00
|
|
|
|
|
|
|
#Create TradeHubs
|
|
|
|
tradeHubs = {
|
2021-05-11 10:34:56 -04:00
|
|
|
"The Jackel" : obj.TradeHub("The Jackel"),
|
|
|
|
"Star Crapper" : obj.TradeHub("Star Crapper")
|
2021-05-10 18:17:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
tradeHubs["The Jackel"].addItems(tradeableItems)
|
|
|
|
|
2021-05-11 16:29:45 -04:00
|
|
|
tradeableItems.pop()
|
2021-05-10 18:17:34 -04:00
|
|
|
|
|
|
|
tradeHubs["Star Crapper"].addItems(tradeableItems)
|
|
|
|
|
|
|
|
# Create Planets
|
|
|
|
planets = {
|
2021-05-11 10:34:56 -04:00
|
|
|
"BoB" : obj.Planet("BoB"),
|
|
|
|
"Luna" : obj.Planet("Luna")
|
2021-05-10 18:17:34 -04:00
|
|
|
}
|
|
|
|
planets["BoB"].addTradeHub(tradeHubs["Star Crapper"])
|
2021-05-10 19:13:26 -04:00
|
|
|
planets["Luna"].addTradeHub(tradeHubs["The Jackel"])
|
2021-05-10 18:17:34 -04:00
|
|
|
|
|
|
|
# Create user
|
2021-05-10 16:14:23 -04:00
|
|
|
userInput = ""
|
2021-05-10 16:25:51 -04:00
|
|
|
|
2021-05-10 18:17:34 -04:00
|
|
|
userInput = input("What is your name... peasant?\n>> ")
|
2021-05-10 16:25:51 -04:00
|
|
|
|
|
|
|
if userInput == "":
|
|
|
|
userInput = "(none)"
|
|
|
|
|
2021-05-10 18:17:34 -04:00
|
|
|
# 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":
|
2021-05-10 18:17:34 -04:00
|
|
|
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():
|
2021-05-10 16:25:51 -04:00
|
|
|
titleScreen()
|
2021-05-10 16:14:23 -04:00
|
|
|
|
|
|
|
main()
|