pacgo icon indicating copy to clipboard operation
pacgo copied to clipboard

A Pac Man clone written in Go (with emojis!)

Results 6 pacgo issues
Sort by recently updated
recently updated
newest added

For the latest go version libraries need to have a go mod file for dependency management. Found by calling in directory step02 go run main.go output: main.go:10:2: no required module...

In step 6 channels are introduced for processing the user input in the game loop. At the end of the step a delay with sleep is added to the game...

` var pillTimer *time.Timer var pillMx sync.Mutex func processPill() { pillMx.Lock() updateGhosts(ghosts, GhostStatusBlue) if pillTimer != nil { pillTimer.Stop() } pillTimer = time.NewTimer(time.Second * cfg.PillDurationSecs) pillMx.Unlock()

os :wsl go version :1.15 execute main.go in step02 raise a error of stty: 'standard input': Inappropriate ioctl for device

func updatePlayerPosition(newRow, newCol int) { // 移动玩家位置前,先清除当前位置 simpleansi.MoveCursor(player.row, player.col) fmt.Print(" ") // 更新玩家位置 player.row = newRow player.col = newCol // 打印新的玩家位置 simpleansi.MoveCursor(player.row, player.col) fmt.Print("P") // 移动光标到迷宫绘制区域之外 simpleansi.MoveCursor(len(maze)+1, 0) }