From a9209bb2618839386b544b14fcfa71ab740a7a17 Mon Sep 17 00:00:00 2001 From: Berger Lena Date: Fri, 8 May 2026 16:28:40 +0200 Subject: [PATCH] chore:cleanup settings.py structure and formatting - remove HP bar colors - fix double parentheses in start and end screen background colors - add section headers for PLAYER and SPRITE - improve spacing and structure between sections --- src/settings.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/settings.py b/src/settings.py index 36b11aa..3d4328a 100644 --- a/src/settings.py +++ b/src/settings.py @@ -1,8 +1,8 @@ -# --- DESK --- from typing import Mapping, Literal, Tuple from src.map import tile_size +# --- DESK --- DESK_WIDTH = 70 DESK_HEIGHT = 40 @@ -13,13 +13,15 @@ DOOR_BORDER_WIDTH = 3 COLOR_DOOR_BEIGE = (245, 245, 220) COLOR_DOOR_BORDER = (100, 90, 80) -COLOR_HP_BAR_GREEN = (0, 255, 0) -COLOR_HP_BAR_BG = (50, 50, 50) + +# --- PLAYER --- # Players Constants / Settings # Valid movement/animation directions. Direction = Literal["down", "left", "right", "up"] + +# --- SPRITE --- # Sprite files are grouped by direction. # Example: "down" uses sprite_01.png, sprite_02.png, sprite_03.png. DIRECTION_FRAMES: Mapping[Direction, Tuple[int, int, int]] = { @@ -33,6 +35,7 @@ DIRECTION_FRAMES: Mapping[Direction, Tuple[int, int, int]] = { DEFAULT_SPRITE_HEIGHT: int = 138 DEFAULT_FRAME_TIME: float = 0.16 + # --- ECTS --- START_ECTS_VALUE = 1 # how many ECTS are generated at the beginning ECTS_UPDATE_INTERVAL = 1000 # time in ms = 1 sec @@ -40,26 +43,31 @@ ECTS_UPDATE_INTERVAL = 1000 # time in ms = 1 sec BEER_BOTTLE_ECTS_VALUE = 2 BEER_COST = 50 + # --- BUTTONS --- COLOR_BUTTON = (0, 255, 0) COLOR_BUTTON_HOVER = (200, 255, 0) + # --- STARTSCREEN --- -COLOR_STARTSCREEN_BACKGROUND = ((0, 0, 0)) +COLOR_STARTSCREEN_BACKGROUND = (0, 0, 0) COLOR_STARTSCREEN_FONT_TITLE = (0, 255, 0) COLOR_STARTSCREEN_FONT_LABEL = (0, 255, 255) + # --- ENDSCREEN --- -COLOR_ENDSCREEN_BACKGROUND = ((0, 0, 0)) +COLOR_ENDSCREEN_BACKGROUND = (0, 0, 0) COLOR_ENDSCREEN_TEXT = (255, 255, 255) COLOR_ENDSCREEN_WIN = (0, 255, 0) COLOR_ENDSCREEN_LOSE = (255, 0, 0) FONT_ENDSCREEN = "Arial" + # --- COFFEE --- COFFEE_COST = 30 COFFEE_HEAL_VALUE = 30 + # --- TOWER --- TOWER_COST = 150 PROJECTILE_DMG = 15