Skip to content

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

@yx-Yaoxaing

Description

@yx-Yaoxaing

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)

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions