Mercurial > boomslang
comparison pyntnclick/constants.py @ 594:a9e9a7fbdbcf pyntnclick
Make debug a env variable
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sat, 11 Feb 2012 18:04:23 +0200 |
parents | 1b1ab71535bd |
children | 1faced4e343a |
comparison
equal
deleted
inserted
replaced
593:1eb1537173ef | 594:a9e9a7fbdbcf |
---|---|
1 # Useful constants | 1 # Useful constants |
2 # copyright boomslang team (see COPYRIGHT file for details) | 2 # copyright boomslang team (see COPYRIGHT file for details) |
3 | |
4 import os | |
5 | |
6 DEBUG_ENVVAR = 'PYNTNCLICK_DEBUG' | |
7 | |
8 | |
9 def _get_debug(): | |
10 debug = os.getenv(DEBUG_ENVVAR, default=False) | |
11 if debug in [False, 'False', '0']: | |
12 return False | |
13 return True | |
3 | 14 |
4 | 15 |
5 class GameConstants(object): | 16 class GameConstants(object): |
6 screen = (800, 600) | 17 screen = (800, 600) |
7 snd_freq = 44100 | 18 snd_freq = 44100 |
10 snd_buffer = 1024 # no. of samples | 21 snd_buffer = 1024 # no. of samples |
11 | 22 |
12 button_size = 50 | 23 button_size = 50 |
13 scene_size = (screen[0], screen[1] - button_size) | 24 scene_size = (screen[0], screen[1] - button_size) |
14 frame_rate = 25 | 25 frame_rate = 25 |
15 debug = False | 26 debug = _get_debug() |
16 | 27 |
17 # User event IDs: | 28 # User event IDs: |
18 enter = 1 | 29 enter = 1 |
19 leave = 2 | 30 leave = 2 |