adventurelib:用 Python 3 编写文本冒险游戏的最小库

时间:2021-05-29 05:45:14
【文件属性】:
文件名称:adventurelib:用 Python 3 编写文本冒险游戏的最小库
文件大小:35KB
文件格式:ZIP
更新时间:2021-05-29 05:45:14
Python 冒险库 adventurelib提供了编写基于文本的冒险游戏的基本功能,目的是让青少年轻松上手。 Adventurelib 的基础是能够定义响应命令而调用的函数。 例如,您可以编写一个函数,当用户键入诸如“take hat”之类的命令时将调用该函数: @when('take THING') def take(thing): print(f'You take the {thing}.') inventory.append(thing) 它还包括编写涉及房间、物品、角色等的游戏所需的基础……但是用户在探索 Python 编程概念时必须自己实现这些功能。 安装 adventurelib.py是一个可以复制到您的项目中的单个文件。 您也可以使用 pip 安装它: pip install adventurelib 文档
【文件预览】:
adventurelib-master
----setup.py(1KB)
----.gitignore(1KB)
----.travis.yml(371B)
----MANIFEST.in(92B)
----LICENSE(1KB)
----doc()
--------installing.rst(563B)
--------Makefile(8KB)
--------items.rst(6KB)
--------index.rst(784B)
--------conf.py(10KB)
--------commands.rst(11KB)
--------intro.rst(4KB)
--------overview.rst(4KB)
--------changelog.rst(798B)
--------customising.rst(3KB)
--------rooms.rst(6KB)
----README.md(1KB)
----demo_game.py(2KB)
----adventurelib.py(18KB)
----test_adventurelib.py(10KB)
----tox.ini(212B)

网友评论