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
This commit is contained in:
+13
-5
@@ -1,8 +1,8 @@
|
|||||||
# --- DESK ---
|
|
||||||
from typing import Mapping, Literal, Tuple
|
from typing import Mapping, Literal, Tuple
|
||||||
|
|
||||||
from src.map import tile_size
|
from src.map import tile_size
|
||||||
|
|
||||||
|
# --- DESK ---
|
||||||
DESK_WIDTH = 70
|
DESK_WIDTH = 70
|
||||||
DESK_HEIGHT = 40
|
DESK_HEIGHT = 40
|
||||||
|
|
||||||
@@ -13,13 +13,15 @@ DOOR_BORDER_WIDTH = 3
|
|||||||
|
|
||||||
COLOR_DOOR_BEIGE = (245, 245, 220)
|
COLOR_DOOR_BEIGE = (245, 245, 220)
|
||||||
COLOR_DOOR_BORDER = (100, 90, 80)
|
COLOR_DOOR_BORDER = (100, 90, 80)
|
||||||
COLOR_HP_BAR_GREEN = (0, 255, 0)
|
|
||||||
COLOR_HP_BAR_BG = (50, 50, 50)
|
|
||||||
|
|
||||||
|
|
||||||
|
# --- PLAYER ---
|
||||||
# Players Constants / Settings
|
# Players Constants / Settings
|
||||||
# Valid movement/animation directions.
|
# Valid movement/animation directions.
|
||||||
Direction = Literal["down", "left", "right", "up"]
|
Direction = Literal["down", "left", "right", "up"]
|
||||||
|
|
||||||
|
|
||||||
|
# --- SPRITE ---
|
||||||
# Sprite files are grouped by direction.
|
# Sprite files are grouped by direction.
|
||||||
# Example: "down" uses sprite_01.png, sprite_02.png, sprite_03.png.
|
# Example: "down" uses sprite_01.png, sprite_02.png, sprite_03.png.
|
||||||
DIRECTION_FRAMES: Mapping[Direction, Tuple[int, int, int]] = {
|
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_SPRITE_HEIGHT: int = 138
|
||||||
DEFAULT_FRAME_TIME: float = 0.16
|
DEFAULT_FRAME_TIME: float = 0.16
|
||||||
|
|
||||||
|
|
||||||
# --- ECTS ---
|
# --- ECTS ---
|
||||||
START_ECTS_VALUE = 1 # how many ECTS are generated at the beginning
|
START_ECTS_VALUE = 1 # how many ECTS are generated at the beginning
|
||||||
ECTS_UPDATE_INTERVAL = 1000 # time in ms = 1 sec
|
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_BOTTLE_ECTS_VALUE = 2
|
||||||
BEER_COST = 50
|
BEER_COST = 50
|
||||||
|
|
||||||
|
|
||||||
# --- BUTTONS ---
|
# --- BUTTONS ---
|
||||||
COLOR_BUTTON = (0, 255, 0)
|
COLOR_BUTTON = (0, 255, 0)
|
||||||
COLOR_BUTTON_HOVER = (200, 255, 0)
|
COLOR_BUTTON_HOVER = (200, 255, 0)
|
||||||
|
|
||||||
|
|
||||||
# --- STARTSCREEN ---
|
# --- STARTSCREEN ---
|
||||||
COLOR_STARTSCREEN_BACKGROUND = ((0, 0, 0))
|
COLOR_STARTSCREEN_BACKGROUND = (0, 0, 0)
|
||||||
COLOR_STARTSCREEN_FONT_TITLE = (0, 255, 0)
|
COLOR_STARTSCREEN_FONT_TITLE = (0, 255, 0)
|
||||||
COLOR_STARTSCREEN_FONT_LABEL = (0, 255, 255)
|
COLOR_STARTSCREEN_FONT_LABEL = (0, 255, 255)
|
||||||
|
|
||||||
|
|
||||||
# --- ENDSCREEN ---
|
# --- ENDSCREEN ---
|
||||||
COLOR_ENDSCREEN_BACKGROUND = ((0, 0, 0))
|
COLOR_ENDSCREEN_BACKGROUND = (0, 0, 0)
|
||||||
COLOR_ENDSCREEN_TEXT = (255, 255, 255)
|
COLOR_ENDSCREEN_TEXT = (255, 255, 255)
|
||||||
COLOR_ENDSCREEN_WIN = (0, 255, 0)
|
COLOR_ENDSCREEN_WIN = (0, 255, 0)
|
||||||
COLOR_ENDSCREEN_LOSE = (255, 0, 0)
|
COLOR_ENDSCREEN_LOSE = (255, 0, 0)
|
||||||
FONT_ENDSCREEN = "Arial"
|
FONT_ENDSCREEN = "Arial"
|
||||||
|
|
||||||
|
|
||||||
# --- COFFEE ---
|
# --- COFFEE ---
|
||||||
COFFEE_COST = 30
|
COFFEE_COST = 30
|
||||||
COFFEE_HEAL_VALUE = 30
|
COFFEE_HEAL_VALUE = 30
|
||||||
|
|
||||||
|
|
||||||
# --- TOWER ---
|
# --- TOWER ---
|
||||||
TOWER_COST = 150
|
TOWER_COST = 150
|
||||||
PROJECTILE_DMG = 15
|
PROJECTILE_DMG = 15
|
||||||
|
|||||||
Reference in New Issue
Block a user