geekdoc-python-zh/docs/pythoncentral/build-games-python-using-py...

11 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 使用 Pygame 为 Python 构建游戏
> 原文:<https://www.pythoncentral.io/build-games-python-using-pygame/>
Pygame 是一组模块,通过提供额外的功能和库来帮助你编写 Python 游戏。它是免费的,支持 Python 3.2 和更高版本,可以在几乎所有的操作系统和平台上运行,并且有超过一百万的下载量,所以它的应用非常广泛。
[![Build Games for Python Using Pygame](img/b4d8d00485ab3ffde97323b750a47a15.png)](http://www.pygame.org/wiki/about)
Pygame 速度超快,因为它对核心函数使用了优化的 C(C 可以比 Python 快 10 到 20 倍)。该库还提供了快速而周到的支持——如果您发现了一个 bug 或者遇到了代码的任何问题,他们会非常积极地响应。成千上万的游戏都是用 Pygame 制作的,包括[这款](http://www.pygame.org/project-Strong+Jesse-3018-5048.html)街机风格的游戏,目标是尽可能多地射击小行星,并接回被困的宇航员返回空间站。
不仅用 Pygame 制作游戏很有趣(创建者说“包含了愚蠢”),而且玩用这个库创建的游戏也很有趣。如果你是一个游戏制作者,一直在寻找能使 Python 游戏的制作过程更快更有效的模块和库Pygame 可能是适合你的工具。如果你需要帮助,请务必查看[教程](http://www.pygame.org/wiki/tutorials)页面。