From 36864f494db5e9b7694bf8ddbc665717b346c30b Mon Sep 17 00:00:00 2001 From: Kylin_on_Mac Date: Fri, 22 Sep 2023 17:55:43 +0800 Subject: [PATCH] doc: update README.md --- README.md | 17 +++++++++++------ blockly.json | 4 ++-- game_config.json | 2 +- requirements.txt | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6b315a5..f35889b 100644 --- a/README.md +++ b/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`:是否通關 --- \ No newline at end of file diff --git a/blockly.json b/blockly.json index 209b6bf..922740c 100644 --- a/blockly.json +++ b/blockly.json @@ -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", "食物的高度"] ], diff --git a/game_config.json b/game_config.json index 19bdc1a..bd1b77b 100644 --- a/game_config.json +++ b/game_config.json @@ -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": [ diff --git a/requirements.txt b/requirements.txt index 6b60966..936367f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -mlgame>=9.5.1.7b0 \ No newline at end of file +mlgame>=10.3.1 \ No newline at end of file