From 757ffabb402dbe72816cb3ae6c40b42e3c91f76b Mon Sep 17 00:00:00 2001 From: CharlesPikachu <1159254961@qq.com> Date: Mon, 21 Mar 2022 00:16:47 +0800 Subject: [PATCH] update docs --- README.md | 4 +- docs/Author.md | 10 ++- docs/Changelog.md | 10 ++- docs/Install.md | 29 +++++--- docs/Quickstart.md | 176 +++++++++++++++++++++++++++++++-------------- setup.py | 2 +- 6 files changed, 159 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index 5a71ee9..aac5d89 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,8 @@ This repository is created just for learning python(Commercial prohibition). #### Whl install ```sh -wget https://github.com/CharlesPikachu/Games/releases/download/v0.1.0/cpgames-0.1.0-py3-none-any.whl -pip install cpgames-0.1.0-py3-none-any.whl +wget https://github.com/CharlesPikachu/Games/releases/download/v0.1.1/cpgames-0.1.1-py3-none-any.whl +pip install cpgames-0.1.1-py3-none-any.whl ``` #### Pip install diff --git a/docs/Author.md b/docs/Author.md index 8cdcb65..2358e5e 100644 --- a/docs/Author.md +++ b/docs/Author.md @@ -1,15 +1,13 @@ # 关于作者 -``` 学生党, 主要研究方向是计算机视觉, 顺便对信息安全感兴趣。 我的个人微信公众号是: Charles_pikachu (欢迎搜索关注,或者搜"Charles的皮卡丘") -我的Github账号是: https://github.com/CharlesPikachu +我的Github账号是: [https://github.com/CharlesPikachu](https://github.com/CharlesPikachu) ((欢迎搜索关注)) -我的知乎账号是: https://www.zhihu.com/people/charles_pikachu +我的知乎账号是: [https://www.zhihu.com/people/charles_pikachu](https://www.zhihu.com/people/charles_pikachu) (欢迎搜索关注) -我的B站账号是: https://space.bilibili.com/406756145 +我的B站账号是: [https://space.bilibili.com/406756145](https://space.bilibili.com/406756145) (欢迎搜索关注) -个人邮箱: charlesblwx@gmail.com -``` \ No newline at end of file +个人邮箱: charlesblwx@gmail.com \ No newline at end of file diff --git a/docs/Changelog.md b/docs/Changelog.md index 01d9b06..8d3d41e 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,3 +1,11 @@ # 开发日志 -- 2022-01-08: 完成v0.1.0, 集成了27款小游戏 \ No newline at end of file +#### 2022-01-08 + +- 版本号: v0.1.0, +- 更新内容: 集成了27款小游戏。 + +#### 2022-03-21 + +- 版本号: v0.1.1, +- 更新内容: 集成了半成品魔塔小游戏, 修复了Linux下运行存在的字体导入BUG。 \ No newline at end of file diff --git a/docs/Install.md b/docs/Install.md index f13dfe7..14ffd81 100644 --- a/docs/Install.md +++ b/docs/Install.md @@ -1,44 +1,57 @@ # 安装CPGames -## 环境配置 +#### 环境配置 + - 操作系统: Linux or macOS or Windows - Python版本: Python3.6+ -## Whl文件安装(推荐) +#### Whl文件安装(推荐) + 在终端运行如下命令即可(请保证python在环境变量中): + ```sh -wget https://github.com/CharlesPikachu/Games/releases/download/v0.1.0/cpgames-0.1.0-py3-none-any.whl -pip install cpgames-0.1.0-py3-none-any.whl +wget https://github.com/CharlesPikachu/Games/releases/download/v0.1.1/cpgames-0.1.1-py3-none-any.whl +pip install cpgames-0.1.1-py3-none-any.whl ``` -## PIP安装(推荐) +#### PIP安装(推荐) + 在终端运行如下命令即可(请保证python在环境变量中): + ```sh pip install cpgames --upgrade ``` -## 源代码安装 +#### 源代码安装 + +**1.在线安装** -#### 在线安装 运行如下命令即可在线安装: + ```sh pip install git+https://github.com/CharlesPikachu/Games.git@master ``` -#### 离线安装 +**2.离线安装** + 利用如下命令下载Games源代码到本地: + ```sh git clone https://github.com/CharlesPikachu/Games.git ``` + 接着, 切到Games目录下: + ```sh cd Games ``` + 最后运行如下命令进行安装: + ```sh python setup.py install ``` \ No newline at end of file diff --git a/docs/Quickstart.md b/docs/Quickstart.md index 92d34de..fbf7c57 100644 --- a/docs/Quickstart.md +++ b/docs/Quickstart.md @@ -4,11 +4,13 @@ ## 已经支持的小游戏 #### 兔子和獾(射击游戏) -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/_-AChGldQzdwXN-ljcCMFQ) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -17,11 +19,13 @@ game_client.execute('bunnybadger') ``` #### 仿八分音符的声控小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/NmK5fAMoOHahOf6OvV6XFA) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -30,11 +34,13 @@ game_client.execute('voicecontrolpikachu') ``` #### 拼图小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/tcmrbNCptka2ZTfEs-W_Lg) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -43,11 +49,13 @@ game_client.execute('puzzlepieces') ``` #### 滑雪游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/2MVTEa4ut9TOAgBOOWEUSg) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -56,11 +64,13 @@ game_client.execute('ski') ``` #### 经典坦克大战小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/1xXULpT36P7LTO5HDbjptg) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -69,11 +79,13 @@ game_client.execute('tankwar') ``` #### 飞扬的小鸟小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/44CZjwvjnH0kkkKIn5U9Uw) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -82,11 +94,13 @@ game_client.execute('flappybird') ``` #### 仿谷歌浏览器小恐龙游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/PnvcSBe0Va3GVIodGIjYRg) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -95,11 +109,13 @@ game_client.execute('trexrush') ``` #### 塔防游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/mcnN3dF5tzWlRg91cnWTEw) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -108,11 +124,13 @@ game_client.execute('towerdefense') ``` #### 接金币小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/ZmMm7MKo7VyWZUAHEe9_JQ) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -121,11 +139,13 @@ game_client.execute('catchcoins') ``` #### 飞机大战 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/n-f_6sh8bB7-dtIFJLbnFg) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -134,11 +154,13 @@ game_client.execute('aircraftwar') ``` #### 俄罗斯方块 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/KFqpjmH6juZ2K8uKOoEaaA) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -147,11 +169,13 @@ game_client.execute('tetris') ``` #### 推箱子 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/y6CZd4h3uo7602LrI7aFdQ) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -160,11 +184,13 @@ game_client.execute('sokoban') ``` #### 外星人入侵小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/9UylZkV3sVTQLjThIaVObg) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -173,11 +199,13 @@ game_client.execute('alieninvasion') ``` #### 吃豆人小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/UBVLDW2T-Y6R-0IaRfu81Q) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -186,11 +214,13 @@ game_client.execute('pacman') ``` #### 消消乐 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/H0dFwoEcJT-JPKfNvPt2Kw) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -199,11 +229,13 @@ game_client.execute('gemgem') ``` #### 24点小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/raronw7X0WlntI48nUOvoQ) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -212,11 +244,13 @@ game_client.execute('twentyfourpoint') ``` #### 乒乓球小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/C6v0Zj8-fhysqRQ_lcEZIQ) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -225,11 +259,13 @@ game_client.execute('pingpong') ``` #### 打砖块小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/9tNVTA06dFthdugNs3TePA) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -238,11 +274,13 @@ game_client.execute('breakoutclone') ``` #### 炸弹人小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/XzB_cJMFEtz6p_MvqiaCrA) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -251,11 +289,13 @@ game_client.execute('bomberman') ``` #### 走迷宫小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/s9jburcC4WaOO_0ce54-Rg) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -264,11 +304,13 @@ game_client.execute('maze') ``` #### 打地鼠 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/OFtW2Lx5i0Y9GXrF_PyqaA) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -277,11 +319,13 @@ game_client.execute('whacamole') ``` #### 五子棋小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/79aBuK_EytVAbDp5hY8cHA) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -290,11 +334,13 @@ game_client.execute('gobang') ``` #### 2048小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/WJhg4J0MuuEcmDasRzuE9Q) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -303,11 +349,13 @@ game_client.execute('twozerofoureight') ``` #### 贪吃蛇小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/YdRLYz4BnfgRZMYqKvDnRA) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -316,11 +364,13 @@ game_client.execute('greedysnake') ``` #### 扫雷小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/O2nKNsWUigrKomW3l29Zlw) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -329,11 +379,13 @@ game_client.execute('minesweeper') ``` #### 愤怒的小鸟 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/-Z_4PEF7f3ZS1CKd9D6Brg) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames @@ -342,14 +394,30 @@ game_client.execute('angrybirds') ``` #### 记忆翻牌小游戏 -1.公众号文章链接 + +**1.公众号文章链接** [点击查看](https://mp.weixin.qq.com/s/H5UisWDWubdaQEBo-sH6iA) -2.调用示例代码 +**2.调用示例代码** + ```python from cpgames import cpgames game_client = cpgames.CPGames() game_client.execute('flipcardbymemory') +``` + + +## 随机运行一个小游戏 + +代码实现如下: + +```python +import random +from cpgames import cpgames + +game_client = cpgames.CPGames() +all_supports = game_client.getallsupported() +game_client.execute(random.choice(list(all_supports.values()))) ``` \ No newline at end of file diff --git a/setup.py b/setup.py index 03d8ba7..315295d 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ 'cpgames.modules.core.twozerofoureight': ['resources/audios/*'], 'cpgames.modules.core.voicecontrolpikachu': ['resources/images/*'], 'cpgames.modules.core.whacamole': ['resources/audios/*', 'resources/images/*'], - 'cpgames.modules.core.magictower': ['resources/images/*', 'resources/levels/*', 'resources/fonts/*'], + 'cpgames.modules.core.magictower': ['resources/images/*', 'resources/levels/*', 'resources/fonts/*', 'resources/images/map0/*', 'resources/images/map1/*', 'resources/images/player/*'], }