@@ -2,34 +2,34 @@
> * 原文作者:[Dr Pommes](https://medium.com/@pommes)
> * 译文出自:[掘金翻译计划](https://github.com/xitu/gold-miner)
> * 本文永久链接:[https://github.com/xitu/gold-miner/blob/master/article/2020/writing-tetris-in-python.md](https://github.com/xitu/gold-miner/blob/master/article/2020/writing-tetris-in-python.md)
> * 译者:
> * 校对者:
> * 译者:[z0gSh1u](https://github.com/z0gSh1u)
> * 校对者:[Park-ma](https://github.com/Park-ma)、[Zhengjian-L](https://github.com/Zhengjian-L)
#Writing Tetris inPython
#用Python写一个俄罗斯方块游戏
Step by step guide to writing Tetris inPython with PyGame
使用Python 的 PyGame库写一个俄罗斯方块游戏的逐步指南
In this tutorial, we will write a simple Tetris using thePyGame library in Python. The algorithms inside are pretty simple but can be a little challenging for the beginners. We will not concentrate onPyGame mechanics too much, but rather focus on the game logic. If you are too lazy to read all the stuff, you may simply copy and paste the code in the end.
在这篇教程中,我们会用 Python 的PyGame 库写一个简单的俄罗斯方块游戏。里面的算法很简单,但对新手可能有一点挑战性。我们不会太关注PyGame 的内部原理,而更关注游戏的逻辑。如果你懒得阅读整篇文章,你可以简单地复制粘贴文末的代码。
![Tetris Game](https://cdn-images-1.medium.com/max/2000/1*zJwBMHhqoVES9LbIg68qxQ.gif)
![俄罗斯方块游戏](https://cdn-images-1.medium.com/max/2000/1*zJwBMHhqoVES9LbIg68qxQ.gif)
####Prerequisites
####准备工作
1. Python3. This may be downloaded from the [official website](https://www.python.org/downloads/).
2. PyGame. Go to your command prompt or terminal, depending on the OS you are using, and type`pip install pygame` or `pip3 install pygame`.
3. Basic knowledge ofPython. See my other articles for that if needed.
1. Python 3。这可以从 [官方网站](https://www.python.org/downloads/)下载。
2. PyGame。根据你正在使用的操作系统,打开命令提示符或者终端,输入`pip install pygame` 或 `pip3 install pygame`。
3. Python的基本知识。如果有需要,可以