From a6fcbbe55f7c476905becadddb2ed1253df84a3f Mon Sep 17 00:00:00 2001 From: Kylin_on_Mac Date: Tue, 10 Oct 2023 23:13:56 +0800 Subject: [PATCH] fix:update level file format --- blockly.json | 8 ++++---- levels/001.json | 2 +- levels/002.json | 4 ++-- levels/003.json | 4 ++-- levels/004.json | 4 ++-- levels/005.json | 4 ++-- levels/006.json | 4 ++-- levels/007.json | 4 ++-- levels/008.json | 4 ++-- levels/009.json | 4 ++-- levels/010.json | 4 ++-- levels/template.json | 6 ++---- src/game.py | 1 + 13 files changed, 26 insertions(+), 27 deletions(-) diff --git a/blockly.json b/blockly.json index 6075ea8..0435f5a 100644 --- a/blockly.json +++ b/blockly.json @@ -13,7 +13,7 @@ ["scene_info['ball_y']", "y coordinate of ball", "球的 y 座標"], ["scene_info['score']", "score", "目前的分數"], ["scene_info['foods']", "list of foods positions", "點點的位置清單"], -// TODO 通關分數 + ["scene_info['score_to_pass']", "the score for next level", "通關分數"], ["scene_info", "dictionary of all information", "包含所有資訊的字典"] ], "CONSTANT": [ @@ -23,9 +23,9 @@ [600, "bottom boundary", "下邊界"], [30, "ball width", "球身的寬度"], [30, "ball height", "球身的高度"], -// TODO - [8, "food width", "食物的寬度"], - [8, "food height", "食物的高度"] + [8, "food lv1 size", "等級一食物的寬高度"], + [12, "food lv2 size", "等級二食物的高度"], + [16, "food lv3 size", "等級三食物的高度"] ], "ACTION": [ ["['UP']", "moving up", "向上移動"], diff --git a/levels/001.json b/levels/001.json index 6a4bd26..2a5c36c 100644 --- a/levels/001.json +++ b/levels/001.json @@ -6,5 +6,5 @@ ], "score_to_pass": 10, "green_food_count": [3,0,0], - "black_food_count": [1,0,0] + "black_food_count": [0,0,0] } \ No newline at end of file diff --git a/levels/002.json b/levels/002.json index bb34c84..1d7ad96 100644 --- a/levels/002.json +++ b/levels/002.json @@ -5,6 +5,6 @@ 200 ], "score_to_pass": 15, - "green_food_count": 5, - "black_food_count": 0 + "green_food_count": [5,0,0], + "black_food_count": [0,0,0] } \ No newline at end of file diff --git a/levels/003.json b/levels/003.json index af6dd30..db4160f 100644 --- a/levels/003.json +++ b/levels/003.json @@ -5,6 +5,6 @@ 300 ], "score_to_pass": 15, - "green_food_count": 10, - "black_food_count": 0 + "green_food_count": [10,0,0], + "black_food_count": [0,0,0] } \ No newline at end of file diff --git a/levels/004.json b/levels/004.json index 34d2278..2c642fd 100644 --- a/levels/004.json +++ b/levels/004.json @@ -5,6 +5,6 @@ 300 ], "score_to_pass": 15, - "green_food_count": 7, - "black_food_count": 3 + "green_food_count": [7,0,0], + "black_food_count": [3,0,0] } \ No newline at end of file diff --git a/levels/005.json b/levels/005.json index cee2f71..a3da067 100644 --- a/levels/005.json +++ b/levels/005.json @@ -5,6 +5,6 @@ 300 ], "score_to_pass": 15, - "green_food_count": 7, - "black_food_count": 7 + "green_food_count": [7,0,0], + "black_food_count": [7,0,0] } \ No newline at end of file diff --git a/levels/006.json b/levels/006.json index ef06d11..0f3bc6f 100644 --- a/levels/006.json +++ b/levels/006.json @@ -5,6 +5,6 @@ 400 ], "score_to_pass": 15, - "green_food_count": 7, - "black_food_count": 10 + "green_food_count": [7,0,0], + "black_food_count": [10,0,0] } \ No newline at end of file diff --git a/levels/007.json b/levels/007.json index 49c8e26..b6c5251 100644 --- a/levels/007.json +++ b/levels/007.json @@ -5,6 +5,6 @@ 400 ], "score_to_pass": 20, - "green_food_count": 7, - "black_food_count": 13 + "green_food_count": [7,0,0], + "black_food_count": [13,0,0] } \ No newline at end of file diff --git a/levels/008.json b/levels/008.json index 61a8a29..ddc3b55 100644 --- a/levels/008.json +++ b/levels/008.json @@ -5,6 +5,6 @@ 500 ], "score_to_pass": 20, - "green_food_count": 10, - "black_food_count": 15 + "green_food_count": [10,0,0], + "black_food_count": [15,0,0] } \ No newline at end of file diff --git a/levels/009.json b/levels/009.json index bda3f34..167c95f 100644 --- a/levels/009.json +++ b/levels/009.json @@ -5,6 +5,6 @@ 500 ], "score_to_pass": 25, - "green_food_count": 15, - "black_food_count": 30 + "green_food_count": [15,0,0], + "black_food_count": [30,0,0] } \ No newline at end of file diff --git a/levels/010.json b/levels/010.json index 845f344..4caa335 100644 --- a/levels/010.json +++ b/levels/010.json @@ -5,6 +5,6 @@ 600 ], "score_to_pass": 25, - "green_food_count": 20, - "black_food_count": 40 + "green_food_count": [20,0,0], + "black_food_count": [40,0,0] } \ No newline at end of file diff --git a/levels/template.json b/levels/template.json index 487a087..3b9a69a 100644 --- a/levels/template.json +++ b/levels/template.json @@ -5,9 +5,7 @@ 200 ], "score_to_pass": 10, - "green_food_count": 3, - "black_food_count": 0, - "green_food_list": [3,2,1], - "black_food_list": [5,2,0] + "green_food_count": [3,0,0], + "black_food_count": [0,0,0] } \ No newline at end of file diff --git a/src/game.py b/src/game.py index 812006b..170c3e8 100644 --- a/src/game.py +++ b/src/game.py @@ -149,6 +149,7 @@ class EasyGame(PaiaGame): "ball_y": self.ball.rect.centery, "foods": foods_data, "score": self.score, + "score_to_pass":self._score_to_pass, "status": self.get_game_status() }