Files
battery/game/settings.py

52 lines
2.5 KiB
Python
Raw Normal View History

2026-07-21 19:36:02 -04:00
"""Global tunables. Anything a level does not override falls back to these."""
# --- Display -----------------------------------------------------------------
2026-08-01 12:19:46 -04:00
TILE = 32 # default tile size in pixels (levels may override)
2026-07-21 19:36:02 -04:00
FPS = 60
CAPTION = "Dying Phone"
# Debug view only: how many extra tiles to reveal beyond the level on every side,
# so off-screen geometry (e.g. an invisible catch-wall a step off the map) is
# visible while designing. The true play area is outlined within this margin.
2026-08-01 12:19:46 -04:00
DEBUG_VIEW_MARGIN = 1 # tiles of overscan shown around the level in debug
2026-07-21 19:36:02 -04:00
# --- Physics (pixels / second, unless noted) ---------------------------------
2026-08-01 12:19:46 -04:00
GRAVITY = 2200.0 # downward acceleration
MAX_FALL = 1400.0 # terminal velocity
MOVE_SPEED = 320.0 # horizontal run speed
ACCEL = 3200.0 # ground acceleration toward target speed
AIR_ACCEL = 2200.0 # weaker control in the air
FRICTION = 3600.0 # deceleration when no input on ground
JUMP_SPEED = 760.0 # initial upward velocity of a jump
JUMP_CUT = 0.45 # velocity retained when jump released early (variable height)
COYOTE_TIME = 0.10 # seconds after leaving a ledge you can still jump
JUMP_BUFFER = 0.10 # seconds a jump press is remembered before landing
2026-07-21 19:36:02 -04:00
# --- Gameplay ----------------------------------------------------------------
2026-08-01 12:19:46 -04:00
DEFAULT_BATTERY = 45.0 # seconds of phone battery if a level doesn't set one
2026-07-21 19:36:02 -04:00
DEFAULT_BATTERY_PCT = 12.0 # how full the battery *looks* at the start (visual only;
2026-08-01 12:19:46 -04:00
# the phone is dying, so the bar reads near-empty)
DEATH_PAUSE = 0.5 # seconds the corpse lingers (traps frozen) before respawn
CHARGE_TIME = 1.0 # seconds the battery-fill animation plays on level clear
FADE_TIME = 0.3 # seconds for each half of the fade-to-black transition
2026-07-21 19:36:02 -04:00
# --- Colors (placeholder rendering) ------------------------------------------
COLOR_BG = (24, 26, 38)
COLOR_HUD = (235, 235, 245)
# Fallback colors + labels for placeholder rectangles, keyed by sprite name.
PLACEHOLDERS = {
2026-08-01 12:19:46 -04:00
"player": ((90, 200, 255), "P"),
"player_dead": ((120, 40, 40), "X"),
"block": ((110, 120, 140), ""),
"goal": ((90, 230, 130), "GOAL"),
"fake_block": ((110, 120, 140), ""), # looks identical to a real block on purpose
"spike": ((230, 80, 80), "^"),
"moving_block": ((150, 130, 90), ""),
"patrol_block": ((130, 100, 170), ""),
2026-07-21 19:36:02 -04:00
"crumble_block": ((150, 120, 100), ""),
"arrow_shooter": ((80, 80, 95), ""),
2026-08-01 12:19:46 -04:00
"arrow": ((250, 220, 90), ">"),
"spike_block": ((150, 156, 172), "*"),
"phase_block": ((90, 180, 210), ""),
2026-07-21 19:36:02 -04:00
}