瀏覽代碼

Bring movePlayer() in to line with the rest.

Sacha Ligthert 2 年之前
父節點
當前提交
a349d221f1
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      game.go
  2. 1 1
      player.go

+ 1 - 1
game.go

@@ -105,7 +105,7 @@ func (game *Game) gameDirector() {
 		game.screen.Show()
 
 		// Process input
-		game.movePlayer(game, <-game.keypresses)
+		game.movePlayer(<-game.keypresses)
 
 		// Move robots
 		game.moveRobots()

+ 1 - 1
player.go

@@ -4,7 +4,7 @@ func (game *Game) drawPlayer() {
 	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 game.player.position.x != 2 {
 			game.player.position.x--