From 74b0af92fd2d988ff1344d6a12a7eed07f38dc18 Mon Sep 17 00:00:00 2001 From: Niklas Haiden Date: Thu, 7 May 2026 21:19:26 +0200 Subject: [PATCH] add some settings for the sprite assets --- src/settings.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/settings.py b/src/settings.py index 4055ea3..2cd5b08 100644 --- a/src/settings.py +++ b/src/settings.py @@ -1,4 +1,24 @@ # --- DESK --- +from typing import Mapping, Literal, Tuple + DESK_WIDTH = 70 DESK_HEIGHT = 40 + + +# Players Constants / Settings +# Valid movement/animation directions. +Direction = Literal["down", "left", "right", "up"] + +# 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]] = { + "down": (1, 2, 3), + "left": (4, 5, 6), + "right": (7, 8, 9), + "up": (10, 11, 12), +} + +# Default drawing size and animation speed. +DEFAULT_SPRITE_HEIGHT: int = 138 +DEFAULT_FRAME_TIME: float = 0.16