elukjanovica 2024-05-21 20:05:37 +03:00
parent eced480e23
commit 52902e988c
4 changed files with 15 additions and 14 deletions

View File

@ -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]

View File

@ -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,

View File

@ -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"}}
{"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"}}

View File

@ -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",