예제 #1
0
	def POST(self):
		"""
		This function responds to user input and generates the proper game screens. This function ultimately controls game flow.

		Parameters:
		None

		Returns:
		None
		"""
		playerStateObject = PlayerState() #Updating player state

		if web.input()['home']=='home': #Checking to see if the player pressed the home button
			raise web.seeother('/home') #If the above is true then homeScreen.html is rendered
		else:
			player_input= web.input()['home'] #Creating web.input() to hold user input information
			player_input= player_input.lower()
			#if DBManager.needLastScreen(playerStateObject.player_id, player_input): #Checks to see if the player has reached the end of the game and the final screen need to be displayed
			#	raise web.seeother('/last') #If the above is true then lastScreen.html is rendered
			DBManager.compareInputToAnswers(playerStateObject.player_id, player_input) #Inserting the action that the player took and inserting that information into the database
			print "compare input run"
			raise web.seeother('/game') #Rendering gameScreen.html