python编的俄罗斯方块游戏分析_用 Python 写一个俄罗斯方块游戏 (

@@ -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的基本知识。如果有需要,可以

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值