X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=tabakrolletjie%2Fconstants.py;h=9e1089281760df2c5782a480faddefae922fa371;hb=28c8033fc20fc71e8a5e39fde868ac3f0ccac374;hp=8e6bac7d4ba92dacb82cd72f5ee83e98e967e57f;hpb=01dc6fdbe8a3107dc7ae1e0901839d329d2bcfe7;p=tabakrolletjie.git diff --git a/tabakrolletjie/constants.py b/tabakrolletjie/constants.py index 8e6bac7..9e10892 100644 --- a/tabakrolletjie/constants.py +++ b/tabakrolletjie/constants.py @@ -1,10 +1,15 @@ """ Game constants. """ +import os + TITLE = "Space Turnips" # Debug -DEBUG = False +DEBUG = os.environ.get("TABAK_DEBUG", "").lower() in ("1", "y", "yes") +DRAW_FPS = os.environ.get("TABAK_DRAW_FPS", "").lower() in ("1", "y", "yes") +# Intervals to average fps over +FPS_FRAMES = 50 # 704 is 768 minus space for window decorations :) SCREEN_SIZE = (1024, 704) @@ -12,6 +17,38 @@ SCREEN_SIZE = (1024, 704) # Frame per second FPS = 60 +# Night length in ticks +NIGHT_LENGTH = 3000 + # Pymunk categories OBSTACLE_CATEGORY = 1 << 0 LIGHT_CATEGORY = 1 << 1 +MOULD_CATEGORY = 1 << 2 +FITTINGS_CATEGORY = 1 << 3 +TURNIP_CATEGORY = 1 << 4 + +# Font definitions +FONTS = { + 'sans': 'DejaVuSans.ttf', + 'bold': 'DejaVuSans-Bold.ttf', +} + +# Sound stuff +FREQ = 44100 +BITSIZE = -16 +CHANNELS = 2 +BUFFER = 1024 +DEFAULT_VOLUME = 1.0 + +NO_SOUND = os.environ.get("TABAK_NO_SOUND", "").lower() in ("1", "y", "yes") + +# Color constants +COLOURS = { + "red": (255, 0, 0), + "green": (0, 255, 0), + "blue": (0, 0, 255), + "cyan": (0, 255, 255), + "yellow": (255, 255, 0), + "magenta": (255, 0, 255), + "white": (255, 255, 255), +}