Signed-off-by: sairate <sairate@sina.cn>

This commit is contained in:
sairate 2025-05-13 16:26:47 +08:00
parent 7931559d85
commit 544bbe296b
2 changed files with 23 additions and 0 deletions

BIN
作品说明文档.doc Normal file

Binary file not shown.

23
流程图.md Normal file
View File

@ -0,0 +1,23 @@
``` mermaid
flowchart TD
A[启动程序] --> B[初始化游戏界面]
B --> C[创建蛇头食物记分板]
C --> D[监听键盘控制方向]
D --> E[进入主游戏循环]
E --> F{是否撞墙或撞自己}
F -- 是 --> G[重置游戏]
G --> E
F -- 否 --> H{是否吃到食物}
H -- 是 --> I[移动食物到新位置]
I --> J[增加蛇身体]
J --> K[更新分数]
K --> L[刷新界面]
L --> E
H -- 否 --> M[移动蛇身体]
M --> L
```