我们使用一些必要的Cookie来确保网站正常运行。

我们使用可选的 Cookie,具体详情请参阅我们的Cookie政策,用于记住您的设置并了解您如何使用我们的网站。

用Python制作游戏,第二版——现已上市!

数以百万计的人最喜欢的就是花上几个小时,在自己最爱的电子游戏中刷高分。但真正动手去制作游戏、享受这种更有成就感的乐趣的人却少之又少!树莓派出版社最新推出的书籍是肖恩·M·特雷西的《用Python制作游戏》第二版,我们希望它能激励你亲手创造属于自己的游戏。用Python制作游戏,我们希望它能激励你亲手创造属于自己的游戏。

An orange background with white abstract video game symbols with text. Text reads: Raspberry Pi Essentials, Second Edition, Make games with Python, Create your own entertainment with Raspberry Pi, and Sean M. Tracey.

从玩家到游戏开发者

Pygame库让使用Python开发游戏和交互式软件变得简单易行。在这本书中,你将学习如何利用Pygame在屏幕上绘图、为对象添加动画、响应用户输入、播放音效,以及模拟物理与力的作用。每一章都会让你对Python游戏开发有更深的理解,同时也会帮助你更透彻地了解自己玩过的那些游戏。不仅如此,你还将学到足以创作出几乎任何想象中游戏的知识。

Two facing pages from the book, Make games with Python, second edition. The page on the left features text from the book and an image that is dominated by a black background, with a curved blue pixelated arc. The page on the right includes text from the book and an image with three distinct elements, a blue square, a green square, and a red square. An arrow extends from each square and is annotated with formulae that indicate the effect of acceleration on each shape.

随着阅读的深入,你将学会如何创建图形并让它们在屏幕上移动。接着,你会进一步掌握如何把图形变成游戏中的“精灵”——也就是角色、障碍物和敌人。你还能让这些精灵遵循你设定的物理规则,并编写代码来处理精灵之间的碰撞。在本书最后两章,你将亲手打造一款射击类游戏,拯救银河系免受外星入侵者的威胁!游戏精灵[12] 这本书中的游戏及教程已在最新的树莓派硬件和操作系统上经过测试,可在Windows、macOS或Linux系统上运行。

Two facing pages from the book, Make games with Python, second edition. The page on the left features text from the book and an image with a deep blue, starry space background. The foreground features a green, horizontal layout of pixelated, teal-coloured alien spaceship invaders. The player's spaceship is depicted at the bottom center. The page on the right features text from the book and a diagram with three panels. The first panel shows the game screen with numerous alien invaders approaching the player's spaceship. The second panel shows a matrix of ones and zeroes, and the third shows the same matrix with each one replaced by an alien invader, and each zero replaced by a blank space.

本书中的游戏及说明已在最新的树莓派硬件和操作系统上经过测试,同时兼容 Windows、macOS 和 Linux 系统。

今天就立即获取你的版本

虽然本书并非专为编程零基础者设计,但对于初学者来说也并不算过于复杂。这本新书现已在……发售,售价13.99英镑。你也可以在……找到它。如果你已经用Python(或类似语言)编写过简单的程序,并且能够较为轻松地完成一些基本的计算机操作(如创建文件、浏览文件系统),那么你就已经准备好开始学习了。我们的网上商店上发售——以及在线下门店征服命令行,第三版——现已上市!英国亚马逊或美国亚马逊制作人星期一:展示你的精彩树莓派作品

4条评论

Archisman Panigrahi avatar

2025年8月23日,

John Reebel avatar

如果你不懂三角函数,那么在其中几章里你可能会感到困惑。

romsflare avatar

哪些电子调速器(ESC)与基于Python的游戏应用程序和可编程控制系统兼容?它们如何集成以实现实时输入处理、仿真或由游戏驱动的硬件控制?

评论已关闭