Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When redrawing in full screen, it may cause the screen to flicker #45

Open
yx-Yaoxaing opened this issue Jul 28, 2024 · 0 comments
Open

Comments

@yx-Yaoxaing
Copy link

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)

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant