Bring movePlayer() in to line with the rest.
This commit is contained in:
		
							
								
								
									
										2
									
								
								game.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								game.go
									
									
									
									
									
								
							| @@ -105,7 +105,7 @@ func (game *Game) gameDirector() { | |||||||
| 		game.screen.Show() | 		game.screen.Show() | ||||||
|  |  | ||||||
| 		// Process input | 		// Process input | ||||||
| 		game.movePlayer(game, <-game.keypresses) | 		game.movePlayer(<-game.keypresses) | ||||||
|  |  | ||||||
| 		// Move robots | 		// Move robots | ||||||
| 		game.moveRobots() | 		game.moveRobots() | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ func (game *Game) drawPlayer() { | |||||||
| 	game.screen.SetContent(game.player.position.x, game.player.position.y, '@', nil, game.style) | 	game.screen.SetContent(game.player.position.x, game.player.position.y, '@', nil, game.style) | ||||||
| } | } | ||||||
|  |  | ||||||
| func (g *Game) movePlayer(game *Game, press int) { | func (game *Game) movePlayer(press int) { | ||||||
| 	if press == Left { | 	if press == Left { | ||||||
| 		if game.player.position.x != 2 { | 		if game.player.position.x != 2 { | ||||||
| 			game.player.position.x-- | 			game.player.position.x-- | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user