doc: update README.md
This commit is contained in:
parent
bd36c34942
commit
36864f494d
17
README.md
17
README.md
|
@ -21,13 +21,17 @@
|
|||
|
||||
```python
|
||||
# main.py
|
||||
game = EasyGame(time_to_play=1000, total_point_count=10, score=5, color="FF9800")
|
||||
game = EasyGame(
|
||||
time_to_play, score_to_pass, green_food_count, red_food_count,
|
||||
playground_size: list,level: int = -1)
|
||||
```
|
||||
|
||||
- `time_to_play`:遊戲執行的終止時間,單位是 frame,也就是遊戲內部更新畫面的次數,每更新一次 frame +1
|
||||
- `total_point_count`:遊戲中食物出現的最大數量。
|
||||
- `score`:遊戲通關的點數,要超過這個分數才算過關。
|
||||
- `color`:主角方塊的顏色,使用16進位顏色表示法
|
||||
- `green_food_count`:遊戲中綠色食物的數量。
|
||||
- `red_food_count`:遊戲中紅色食物的數量。
|
||||
- `score_to_pass`:遊戲通關的點數,要超過這個分數才算過關。
|
||||
- `playground_size`:可移動區域的大小。 使用逗號將數字隔開 `width,height` `100,200`
|
||||
- `level`: 選定內建關卡,請注意,使用此設定將會覆蓋掉其他設定,預設為 -1 不選擇任何關卡。
|
||||
|
||||
## 玩法
|
||||
|
||||
|
@ -53,7 +57,7 @@ game = EasyGame(time_to_play=1000, total_point_count=10, score=5, color="FF9800"
|
|||
|
||||
2. 座標系統
|
||||
- 螢幕大小 800 x 600
|
||||
- 主角方塊 50 x 50
|
||||
- 主角方塊 30 x 30
|
||||
- 食物方塊 8 x 8
|
||||
|
||||
---
|
||||
|
@ -64,7 +68,7 @@ game = EasyGame(time_to_play=1000, total_point_count=10, score=5, color="FF9800"
|
|||
|
||||
```bash
|
||||
# 在easy game中,打開終端機
|
||||
python -m mlgame -i ./ml/ml_play_template.py ./ --time_to_play 1200 --total_point_count 15 --score 10 --color FF9800
|
||||
python -m mlgame -i ./ml/ml_play_template.py ./ --time_to_play 1200 --green_food_count 15 --red_food_count 10 --score_to_pass 10 --playground_size 100,200
|
||||
```
|
||||
|
||||
## AI範例
|
||||
|
@ -163,5 +167,6 @@ class MLPlay:
|
|||
- `player`:玩家編號
|
||||
- `score`:吃到的食物總數
|
||||
- `rank`:排名
|
||||
- `passed`:是否通關
|
||||
|
||||
---
|
|
@ -20,8 +20,8 @@
|
|||
[800, "right boundary", "右邊界"],
|
||||
[0, "top boundary", "上邊界"],
|
||||
[600, "bottom boundary", "下邊界"],
|
||||
[50, "ball width", "球身的寬度"],
|
||||
[50, "ball height", "球身的高度"],
|
||||
[30, "ball width", "球身的寬度"],
|
||||
[30, "ball height", "球身的高度"],
|
||||
[8, "food width", "食物的寬度"],
|
||||
[8, "food height", "食物的高度"]
|
||||
],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"game_name": "easy_game",
|
||||
"version": "2.1.0",
|
||||
"version": "2.2.0-beta",
|
||||
"url": "https://github.com/PAIA-Playful-AI-Arena/easy_game",
|
||||
"description": "這是一個吃東西小遊戲,除了讓你熟習所有基本操作,也是 PAIA 的遊戲教學範例",
|
||||
"logo": [
|
||||
|
|
|
@ -1 +1 @@
|
|||
mlgame>=9.5.1.7b0
|
||||
mlgame>=10.3.1
|
Loading…
Reference in New Issue