Configuration
All global configuration for the Medieval Deck game is centralized in the config.py
file. This file defines constants for screen settings, colors, game mechanics, file paths, and AI generation parameters.
Screen Settings
The game is optimized for an ultrawide display.
Constant | Value | Description |
---|---|---|
SCREEN_WIDTH |
3440 |
The width of the game window in pixels. |
SCREEN_HEIGHT |
1440 |
The height of the game window in pixels. |
FPS |
60 |
The target frames per second for the game loop. |
Colors
A predefined palette of colors is available for consistent UI and debugging.
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GRAY = (128, 128, 128)
DARK_GRAY = (64, 64, 64)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
GOLD = (255, 215, 0)
Game Settings
These constants define core gameplay mechanics.
Constant | Value | Description |
---|---|---|
INITIAL_HEALTH |
100 |
The base health for a character (overridden by hero-specific stats). |
INITIAL_MANA |
3 |
The base mana points a player starts with each turn. |
MAX_HAND_SIZE |
7 |
The maximum number of cards a player can hold. |
CARDS_PER_TURN |
1 |
The number of cards drawn at the start of a turn (placeholder). |
File Paths
Directory paths are defined to keep asset management organized.
Constant | Value | Description |
---|---|---|
ASSETS_DIR |
"assets" |
The root directory for all visual assets. |
BACKGROUNDS_DIR |
"assets/backgrounds" |
Directory for AI-generated backgrounds. |
HEROES_DIR |
"assets/heroes" |
Directory for hero-related assets like sprites. |
UI_DIR |
"assets/ui" |
Directory for UI elements. |
AUDIO_DIR |
"audio" |
Directory for sound effects and music. |
CARDS_DIR |
"cards" |
Directory for card definitions and data. |
AI Generation Settings
Parameters controlling the AI asset generation pipeline.
Constant | Value | Description |
---|---|---|
AI_SEED |
42 |
The master seed for the AI model to ensure reproducible image generation. |
AI_IMAGE_SIZE |
(3440, 1440) |
The target resolution for generated images, matching the screen dimensions. |
AI_BATCH_SIZE |
1 |
The number of images to generate at once. Kept at 1 for large resolutions. |
Hero Definitions
The HEROES
dictionary contains the base stats and descriptions for each playable character. This data is used in the hero selection screen.
HEROES = {
"knight": {
"name": "Knight",
"health": 120,
"mana": 2,
"description": "A sturdy warrior with high health and defensive abilities"
},
"mage": {
"name": "Mage",
"health": 80,
"mana": 4,
"description": "A powerful spellcaster with high mana and magical abilities"
},
"assassin": {
"name": "Assassin",
"health": 90,
"mana": 3,
"description": "A swift fighter with balanced stats and critical strikes"
}
}