植物大戰殭屍 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版


分享到:


相關文章: