pacgo icon indicating copy to clipboard operation
pacgo copied to clipboard

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

Open yx-Yaoxaing opened this issue 6 months ago • 0 comments

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)

}

yx-Yaoxaing avatar Jul 28 '24 02:07 yx-Yaoxaing