Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 30 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# 教你用 Python 来玩微信跳一跳
[![GitHub stars](https://img.shields.io/github/stars/wangshub/wechat_jump_game.svg)](https://github.com/wangshub/wechat_jump_game/stargazers) [![GitHub forks](https://img.shields.io/github/forks/wangshub/wechat_jump_game.svg)](https://github.com/wangshub/wechat_jump_game/network) [![GitHub license](https://img.shields.io/github/license/wangshub/wechat_jump_game.svg)](https://github.com/wangshub/wechat_jump_game/blob/master/LICENSE)
# 教你用 Python 來玩微信跳一跳
[![GitHub stars](https://img.shields.io/github/stars/wangshub/wechat_jump_game.svg)](https://github.com/wangshub/wechat_jump_game/stargazers) [![GitHub forks]( https://img.shields.io/github/forks/wangshub/wechat_jump_game.svg)](https://github.com/wangshub/wechat_jump_game/network) [![GitHub license](https://img.shields .io/github/license/wangshub/wechat_jump_game.svg)](https://github.com/wangshub/wechat_jump_game/blob/master/LICENSE)

[![Throughput Graph](https://graphs.waffle.io/wangshub/wechat_jump_game/throughput.svg)](https://waffle.io/wangshub/wechat_jump_game/metrics/throughput)
[![Throughput Graph](https://graphs.waffle.io/wangshub/wechat_jump_game/throughput.svg)](https://waffle.io/wangshub/wechat_jump_game/metrics/throughput)

## 游戏模式
## 遊戲模式

> 2017 年 12 月 28 日下午,微信发布了 6.6.1 版本,加入了「小游戏」功能,并提供了官方 DEMO「跳一跳」。这是一个 2.5D 插画风格的益智游戏,玩家可以通过按压屏幕时间的长短来控制这个「小人」跳跃的距离。分数越高,那么在好友排行榜更加靠前。通过 Python 脚本自动运行,让你轻松霸榜
> 2017 年 12 月 28 日下午,微信發布了 6.6.1 版本,加入了「小遊戲」功能,並提供了官方 DEMO「跳一跳」。這是一個 2.5D 插畫風格的益智遊戲,玩家可以通過按壓屏幕時間的長短來控制這個「小人」跳躍的距離。分數越高,那麼在好友排行榜更加靠前。通過 Python 腳本自動運行,讓你輕鬆霸榜

![](./resource/image/jump.gif)

可能刚开始上手的时候,因为时间距离之间的关系把握不恰当,只能跳出几个就掉到了台子下面。**如果能利用图像识别精确测量出起始和目标点之间测距离,就可以估计按压的时间来精确跳跃。**
可能剛開始上手的時候,因為時間距離之間的關係把握不恰當,只能跳出幾個就掉到了台子下面。 **如果能利用圖像識別精確測量出起始和目標點之間測距離,就可以估計按壓的時間來精確跳躍。 **

## 原理说明
## 原理說明

##### 由于微信检测非常严厉,这里的防禁代码可能已经不起作用,主要供学习用途
##### 由於微信檢測非常嚴厲,這裡的防禁代碼可能已經不起作用,主要供學習用途

1. 将手机点击到《跳一跳》小程序界面
1. 將手機點擊到《跳一跳》小程序界面

2. 用 ADB 工具获取当前手机截图,并用 ADB 将截图 pull 上来
2. 用 ADB 工具獲取當前手機截圖,並用 ADB 將截圖 pull 上來
```shell
adb shell screencap -p /sdcard/autojump.png
adb pull /sdcard/autojump.png .
```

3. 计算按压时间
* 手动版:用 Matplotlib 显示截图,用鼠标先点击起始点位置,然后点击目标位置,计算像素距离
* 自动版:靠棋子的颜色来识别棋子,靠底色和方块的色差来识别棋盘
3. 計算按壓時間
* 手動版:用 Matplotlib 顯示截圖,用鼠標先點擊起始點位置,然後點擊目標位置,計算像素距離
* 自動版:靠棋子的顏色來識別棋子,靠底色和方塊的色差來識別棋盤

4. 用 ADB 工具点击屏幕蓄力一跳
4. 用 ADB 工具點擊屏幕蓄力一跳
```shell
adb shell input swipe x y x y time(ms)
```
Expand All @@ -36,43 +36,42 @@ adb shell input swipe x y x y time(ms)

## 使用教程

相关软件工具安装和使用步骤请参考 [Android 和 iOS 操作步骤](https://github.com/wangshub/wechat_jump_game/wiki/Android-%E5%92%8C-iOS-%E6%93%8D%E4%BD%9C%E6%AD%A5%E9%AA%A4)
相關軟件工具安裝和使用步驟請參考[Android 和iOS 操作步驟](https://github.com/wangshub/wechat_jump_game/wiki/Android-%E5%92%8C-iOS-%E6%93%8D%E4 %BD%9C%E6%AD%A5%E9%AA%A4)

#### 获取源码
#### 獲取源碼

```
- git clone https://github.com/wangshub/wechat_jump_game.git

```
##### 非常推荐使用Python3,避免编码及import问题
##### 非常推薦使用Python3,避免編碼及import問題
## PR 要求
##### 请选择 merge master 分支,并且标题写上简短描述,例子
[优化] 使用PEP8优化代码
##### 請選擇 merge master 分支,並且標題寫上簡短描述,例子
[優化] 使用PEP8優化代碼

## 版本说明
## 版本說明

- master 分支:稳定版本,已通过测试
- dev 分支:开发版本,包含一些较稳定的新功能,累计多个功能并测试通过后合并至 prod 分支
- 其他分支:功能开发 (feature) 或问题修复 (bugfix),属于最新尝鲜版本,可能处于开发中的状态,基本完成后合并至 dev 分支
- master 分支:穩定版本,已通過測試
- dev 分支:開發版本,包含一些較穩定的新功能,累計多個功能並測試通過後合併至 prod 分支
- 其他分支:功能開發 (feature) 或問題修復 (bugfix),屬於最新嚐鮮版本,可能處於開發中的狀態,基本完成後合併至 dev 分支

## FAQ

- 详见 [Wiki-FAQ](https://github.com/wangshub/wechat_jump_game/wiki/FAQ)
- 詳見 [Wiki-FAQ](https://github.com/wangshub/wechat_jump_game/wiki/FAQ)

## 更新日志
## 更新日誌

- 详见 [changelog](https://github.com/wangshub/wechat_jump_game/blob/master/changelog.md)
- 詳見 [changelog](https://github.com/wangshub/wechat_jump_game/blob/master/changelog.md)

## 开发者列表
## 開發者列表

- 详见 [contributors](https://github.com/wangshub/wechat_jump_game/graphs/contributors)
- 詳見 [contributors](https://github.com/wangshub/wechat_jump_game/graphs/contributors)

## 交流

- 314659953 (1000 人)
- 176740763 (500 人)

- 或者关注我的微信公众号后台留言

![](./resource/image/qrcode_for_gh_3586401957c4_258.jpg)
- 或者關注我的微信公眾號後台留言

![](./resource/image/qrcode_for_gh_3586401957c4_258.jpg)