回头启动后在控制台上留下的蓝线

发布于 2025-01-23 14:17:14 字数 536 浏览 3 评论 0原文

因此,我有一个功能,可以使我使用WASD和箭头键在控制台上移动一个完整的Unicode字符。我使用此功能来更改此完整块字符的坐标:

public static void Render(int x, int y)
        {
            Console.Write("\b \b");
            Console.SetCursorPosition(x, y);
            Console.Write("\u2588");
        }

它的工作原理,但是每当我将角色移至右侧时,它都会遗失一些奇怪的东西。看起来像这样: image

当我向右移动时,它在垂直蓝线后面留下我不明白为什么。在我离开的图像中,我将其移到右侧,向下移动,向右移动,重复。我想知道为什么会发生这种情况,以及是否有任何方法可以解决此问题。它只是图形上的,但它使我感到困扰。

So I have a function that lets me move a full block unicode character across the console with wasd and the arrow keys. I use this function to change the coordinates of this full block character:

public static void Render(int x, int y)
        {
            Console.Write("\b \b");
            Console.SetCursorPosition(x, y);
            Console.Write("\u2588");
        }

It works as intended, but there's something weird left behind by it every time I move the character to the right. It looks like this: Image

It leaves behind vertical blue lines when I move it to the right and I don't understand why. In the image I left, I moved it to the right, moved down, moved it further right, repeat. I would like to know why this is happening, and if there is any way to fix this. It's only graphical but it bugs me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文