所以我想开始制作自己的基于终端的游戏,这可行吗?

发布于 2025-01-07 18:15:09 字数 352 浏览 0 评论 0原文

一些基本要求和愿望:

  • Windows/Mac/Linux
  • 在终端窗口中以“全屏”方式运行,根据需要调整大小。
  • 网络多人游戏(宽松的要求,尽管肯定愿意)
  • 基本声音
  • 想要用Python编写,因为我正在学习这一点。
  • 可作为单个包分发,因为没有内置或相当常见的运行时依赖项。

我是否提出了一些不可能的事情? Python 能胜任这项任务吗? 我在使用 Windows 终端时会遇到问题吗?

我不一定非要使用Python,但是我一直在为了其他目的而学习它,所以如果可能的话,我想“把它留在家里”。

感谢您的任何见解。

Some basic requirements and desires:

  • Windows/Mac/Linux
  • Run as "full screen" within the terminal window, resizes as needed.
  • Network multi player (loose requirement, although definitely would like to)
  • Basic sounds
  • Would like to write in Python since I'm learning that.
  • Distributable as a single package, as in no run time dependencies that aren't built in or fairly commonplace.

Am I proposing something impossible?
Is Python up to the task?
Will I have trouble with Windows terminal?

I'm not necessarily hellbent on using Python, however I've been learning it for other purposes, so I'd like to "keep it in the family" if at all possible.

Thanks for any insight.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

蓝戈者 2025-01-14 18:15:09

虽然不是一个完整的解决方案,但我认为 asciimatics 为您提供了所需的大部分构建块。

  • 它是一个跨平台终端库,经过验证可在 Windows、OSX 和 Linux 上运行。
  • 它被设计为全屏运行,处理终端大小调整。
  • 它是用 Python 编写的。
  • 只需使用 pip 即可安装。

您可以从 图库 中了解可能的视觉效果,但您可能需要下载示例并尝试名为 interactive.py 的示例来查看 Sprites 如何处理键盘输入。

您仍然需要在其他地方寻找声音和网络。我希望现有的一些游戏库可以帮助您。

哦,这里全面披露:我写了 asciimatics 包。

While not a complete solution, I think asciimatics gives you most of the building blocks you need.

  • It is a cross-platform terminal library, proven to work on Windows, OSX and Linux.
  • It is designed to run full screen, handling terminal resizing.
  • It is written in Python.
  • It can be installed simply using pip.

You can get a flavour of the possible visual effects from the gallery, but you might want to download the samples and try the sample called interactive.py to see how the Sprites work with keyboard input.

You'd still have to look elsewhere for the sound and networking. I would hope some of the existing game libraries could help you there.

Oh, and full disclosure here: I wrote the asciimatics package.

旧梦荧光笔 2025-01-14 18:15:09

在当今时代,创建一个基于图块的 pygame 游戏并将其所有图块设置为ASCII 符号,而不是创建真正的终端游戏。

我建议你就这样做。

In this day and age, it would actually be easier to create a pygame tile-based game and set all its tiles to ASCII symbols, than it would be to create a real in-terminal game.

I advise you to do just that.

挽梦忆笙歌 2025-01-14 18:15:09

以跨平台且可靠的方式获取终端大小绝非易事(参见 termcap、curses 等)。

Getting terminal size in a cross-platform and reliable way is far from trivial (see termcap, curses and such).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文