diff --git a/TODO b/TODO new file mode 100644 index 0000000..323dc36 --- /dev/null +++ b/TODO @@ -0,0 +1,27 @@ +TODO main: + +[x] fix image loading from last album +[ ] add settings - move pieses = slow/normal/fast/instant +[ ] fix quick game window moving thing +[x] fix image choosing +[ ] add proper image loading from storage +[ ] add small notes on button hover +[ ] add functionality in select and menu mode +[ ] add settings, info and stats with full functionality +[ ] optimise code as possible +[ ] add splash screen +[ ] add keybinds + +TODO additional: + +[ ] ability to control over image cropping +[ ] ability to change keybinds +[ ] more games, puzzle? + +TODO maybe? (but not really): + +[ ] hiding or replacing a player's mouse with a modified one +[ ] interactive objects and dialogs +[ ] creating and using animations using sprites, special effects +[ ] different game modes - sort puzzle in time, player vs player +[ ] hardware support (midi keyboard or controller) \ No newline at end of file diff --git a/main.py b/main.py index 7f076fb..cce1265 100644 --- a/main.py +++ b/main.py @@ -21,6 +21,9 @@ PUZZLE_FILE = "main_puzzle.json" SETTINGS_FILE = "main_settings.json" STATS_FILE = "main_stats.json" +black = (0, 0, 0) +white = (255, 255, 255) + # Data loading and saving @@ -52,16 +55,16 @@ if settings_data["style"] == STYLE_CHOICES[0]: FONT = FONTS[0] STYLE_PATH = "1_" text_color = (1, 35, 61) - oposite_color = (255, 255, 255) + oposite_color = white elif settings_data["style"] == STYLE_CHOICES[1]: FONT = FONTS[1] STYLE_PATH = "2_" - text_color = (255, 255, 255) + text_color = white oposite_color = (70, 35, 0) else: FONT = FONTS[2] STYLE_PATH = "3_" - text_color = (255, 255, 255) + text_color = white oposite_color = text_color if settings_data["size"] == SIZE_CHOICES[0]: @@ -76,7 +79,7 @@ if settings_data["size"] == SIZE_CHOICES[0]: puzzle_size = (128, 128) non_movable_area = pygame.Rect(8, 19, 128, 128) timer_area = pygame.Rect(22, 1, 55, 12) - win_area = pygame.Rect(55, 70, 55, 12) + win_area = pygame.Rect(128//2+10, 128//2+14, 128, 128) size = [20, 25, 100, 15] cons = [15, 195, 12, 3, 9] scaled_size = (18, 21, 108, 108) @@ -118,7 +121,7 @@ else: scaled_size = (43, 48, 310, 310) area = (197, 390) -puzzle_version = settings_data["grid"] +puzzle_version = settings_data["grid"] # Seting screen and other stuff programIcon = pygame.image.load('icon.png') @@ -584,7 +587,7 @@ 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:] - current_data = storage[path_components[0]] + current_data = storage["albums"][path_components[0]] for component in path_components[1:]: if component in current_data: current_data = current_data[component] @@ -606,7 +609,7 @@ def update_puzzle_data(completed, sorted, current_time, current_moves, real_time current_data = [initial_chosen, initial_completed, initial_sorted, initial_moves, formatted_time, current_time, current_moves] print(current_data) - storage[path_components[0]][path_components[1]][path_components[2]] = current_data + storage["albums"][path_components[0]][path_components[1]] = current_data with open(DATA_FILE, 'w') as data_file: data_file.write(json.dumps(storage, indent=3)) @@ -765,7 +768,7 @@ else: path_components = puzzle_data[f'current {puzzle_version}']['selected_image'].split('/')[2:] print(path_components) # why there was an error some time ago? -current_data = storage[path_components[0]] +current_data = storage["albums"][path_components[0]] for component in path_components[1:]: current_data = current_data[component] @@ -1034,7 +1037,7 @@ while run: print(alpha) screen.blit(surface, (non_movable_area.x, non_movable_area.y)) - render_text("You win !!", (win_area.x, win_area.y), screen, (255, 255, 255, text_alpha)) + render_text("You win !!", (win_area.x, win_area.y), screen, (255, 255, 255, text_alpha), True) if pygame.time.get_ticks() < fade_in_end_time: alpha += fade_in_speed diff --git a/main_data.json b/main_data.json index 71e8b9b..e2091ca 100644 --- a/main_data.json +++ b/main_data.json @@ -3,12 +3,12 @@ "Original images": { "1.png": [ 0, - 0, - 0, - 0, + 1, + 1, + 26, "00:00:00", "00:00:00", - 0 + 26 ], "2.png": [ 0, @@ -94,13 +94,13 @@ }, "Birds": { "1.png": [ - 0, - 0, - 0, - 0, + 1, + 1, + 1, + 4, "00:00:00", "00:00:00", - 0 + 2 ], "2.png": [ 0, @@ -113,12 +113,12 @@ ], "3.png": [ 0, - 0, - 0, - 0, - "00:00:01", - "00:00:01", - 0 + 1, + 1, + 56, + "00:00:02", + "00:00:02", + 20 ] } } diff --git a/main_puzzle.json b/main_puzzle.json index 563dead..e7a78bb 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": [[6, 8, 0, 12], [1, 11, 13, 15], [5, 7, 14, 4], [2, 9, 10, 3]], "selected_image": "/images/albums/Birds/3.png"}, "current 3x3": {"matrix": [[3, 6, 7], [5, 4, 1], [0, 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": [[6, 7, 2, 0], [12, 14, 1, 13], [11, 4, 9, 10], [3, 15, 5, 8]], "selected_image": "images/albums/Birds/1.png"}, "current 3x3": {"matrix": [[3, 6, 7], [5, 4, 1], [0, 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 558ebc5..eb7528d 100644 --- a/main_settings.json +++ b/main_settings.json @@ -1,5 +1,5 @@ { - "size": "big" , + "size": "small" , "style": "classic", "grid": "4x4", "gui color": [0, 0],