Exemple #1
0
    def update(self, events):
	'''
        Updates the screen when an event happens 

        @param - list of game events
        '''
        for event in events:
            if not hasattr(event, 'key'): 
                continue
            if event.type == KEYDOWN:
                if event.key == K_p:
                    State.pop_screen()
		elif event.key == K_RETURN:
			self.sounds['select'].play()
			if self.currLine == PauseScreenLines.Resume:
				State.pop_screen()
			if self.currLine == PauseScreenLines.Save:
                            self.tileMap.save(self.player)
                            save(USER_SAVES_DIR + State.save_name)
			elif self.currLine == PauseScreenLines.Quit:
				State.pop_screen()
				State.pop_screen()
		elif event.key == K_i:
		    State.push_screen(InventoryScreen(self.player))
		else:
		    super(PauseScreen, self).interact(event)
Exemple #2
0
	def update(self, events):
		'''
        Updates the screen when an event happens 

        @param - list of game events
        '''
		for event in events:
			if not hasattr(event, 'key'):
				continue
			if event.type == KEYDOWN:
				if event.key == K_RETURN:
					if self.currLine == LoadGameScreenLine.ReturnToMainMenu:
						State.pop_screen()
						continue
					save_name = self.lines[self.currLine]
					load(USER_SAVES_DIR + save_name)
					State.save_name = save_name
					State.pop_screen()
					State.push_screen(gameScreen.GameScreen(CURRENT_GAME_DIR))
				else:
					super(LoadGameScreen, self).interact(event)