From 52902e988cfd496f79ee8f21bc65fbb1a66fe4db Mon Sep 17 00:00:00 2001 From: elukjanovica Date: Tue, 21 May 2024 20:05:37 +0300 Subject: [PATCH] --- main.py | 7 ++++--- main_data.json | 16 ++++++++-------- main_puzzle.json | 2 +- main_settings.json | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/main.py b/main.py index ec91db4..7c3b6fe 100644 --- a/main.py +++ b/main.py @@ -328,7 +328,6 @@ class Button: screen.blit(self.img, self.rect) - # Ability to move window def move_win(coordinates): hwnd = pygame.display.get_wm_info()["window"] @@ -652,7 +651,8 @@ def save_puzzle_state(): def update_puzzle_data(completed, sorted, current_time, current_moves, real_time): - path_components = puzzle_data[f'current {puzzle_version}']['selected_image'].split('/')[2:] + number = 2 if puzzle_version == '4x4' else 3 + path_components = puzzle_data[f'current {puzzle_version}']['selected_image'].split('/')[number:] current_data = storage["albums"][path_components[0]] for component in path_components[1:]: if component in current_data: @@ -961,7 +961,8 @@ else: def load_data(): - path_components = puzzle_data[f'current {puzzle_version}']['selected_image'].split('/')[2:] + number = 2 if puzzle_version == '4x4' else 3 + path_components = puzzle_data[f'current {puzzle_version}']['selected_image'].split('/')[number:] current_data = storage["albums"][path_components[0]] for component in path_components[1:]: current_data = current_data[component] diff --git a/main_data.json b/main_data.json index fb5adba..7813a24 100644 --- a/main_data.json +++ b/main_data.json @@ -2,12 +2,12 @@ "albums": { "Original images": { "1.png": [ + 0, 1, 0, - 0, - 0, - "00:00:00", - "00:00:00", + 9, + "00:00:02", + "00:00:02", 0 ], "2.png": [ @@ -97,10 +97,10 @@ 0, 0, 0, - 0, - "00:00:00", - "00:00:00", - 0 + 17, + "00:00:10", + "00:00:10", + 8 ], "2.png": [ 0, diff --git a/main_puzzle.json b/main_puzzle.json index 48027d7..74e6f47 100644 --- a/main_puzzle.json +++ b/main_puzzle.json @@ -1 +1 @@ -{"puzzle 4x4": [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 0]], "puzzle 3x3": [[1, 2, 3], [4, 5, 6], [7, 8, 0]], "current 4x4": {"matrix": [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 0]], "selected_image": "images/albums/Original images/1.png"}, "current 3x3": {"matrix": [[6, 7, 0], [3, 4, 1], [5, 8, 2]], "selected_image": "/images/albums/Birds/1.png"}} \ No newline at end of file +{"puzzle 4x4": [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 0]], "puzzle 3x3": [[1, 2, 3], [4, 5, 6], [7, 8, 0]], "current 4x4": {"matrix": [[1, 7, 4, 3], [5, 2, 6, 8], [0, 9, 10, 14], [13, 11, 15, 12]], "selected_image": "images/albums/Original images/1.png"}, "current 3x3": {"matrix": [[4, 0, 3], [1, 7, 6], [5, 8, 2]], "selected_image": "/images/albums/Birds/1.png"}} \ No newline at end of file diff --git a/main_settings.json b/main_settings.json index 642d277..59c6fc1 100644 --- a/main_settings.json +++ b/main_settings.json @@ -6,12 +6,12 @@ "music": { "on": true, "volume": 8, - "version": "sunny day" + "version": "serenity" }, "sound": { "on": true, "volume": 4, - "version": "puzzle" + "version": "wood" }, "display": "time", "language": "english",