植物大战僵尸 python版

今天给大家分享的是 https://github.com/ 上 PythonPlantsVsZombies 项目, 学习如何使用 Python 编写小游戏的极佳例子

仅用于个人学习和非商业用途

项目地址

https://github.com/marblexu/PythonPlantsVsZombies

运行步骤:

<code>需要 Python 3.7
安装依赖库:pip install pygame
python main.py/<code>

下面是我运行的过程

<code>C:\\Users\\Administrator\\Desktop\\PythonPlantsVsZombies-master\\PythonPlantsVsZombies-master
$ python main.py
Traceback (most recent call last):
File "main.py", line 1, in <module>
import pygame as pg
ModuleNotFoundError: No module named 'pygame'

C:\\Users\\Administrator\\Desktop\\PythonPlantsVsZombies-master\\PythonPlantsVsZombies-master
$ pip install pygame
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pygame
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/80/2c/3a52e7e9c097229b026b4efbe6711c600f3a84ffdc5f11fd9e7f8932368e/pygame-1.9.6-cp37-cp37m-win32.whl (4.0MB)
|████████████████████████████████| 4.0MB 504kB/s
Installing collected packages: pygame
Successfully installed pygame-1.9.6

C:\\Users\\Administrator\\Desktop\\PythonPlantsVsZombies-master\\PythonPlantsVsZombies-master
$ python main.py
pygame 1.9.6/<module>/<code>


植物大战僵尸 python版


分享到:


相關文章: