Browse code
tweaking settings
Ed L authored on 27/06/2013 23:45:58
Showing 2 changed files
Showing 2 changed files
... | ... |
@@ -34,13 +34,18 @@ import ctypes |
34 | 34 |
import libtcodpy as libtcod |
35 | 35 |
import random |
36 | 36 |
import time |
37 |
+import yaml |
|
37 | 38 |
|
38 | 39 |
inst = lambda a:a() |
39 | 40 |
@inst |
40 | 41 |
class Settings: |
41 |
- SCREEN_WIDTH = 37 |
|
42 |
+ def __init__(self): |
|
43 |
+ with file('settings.yaml') as f: |
|
44 |
+ self.__dict__ = yaml.safe_load(f) |
|
45 |
+ |
|
46 |
+ SCREEN_WIDTH = 75 |
|
42 | 47 |
SCREEN_HEIGHT = 20 |
43 |
- DISPLAY_HEIGHT = SCREEN_HEIGHT+2 |
|
48 |
+ DISPLAY_HEIGHT = property(lambda self: self.SCREEN_HEIGHT+2) |
|
44 | 49 |
LIMIT_FPS = 20 |
45 | 50 |
BASE = 8 |
46 | 51 |
LEVELS = 3 |
... | ... |
@@ -191,7 +196,7 @@ while not libtcod.console_is_window_closed(): |
191 | 196 |
bgcolor = lm.get_color(level, x+offset_x, y+offset_y, bgcolor) |
192 | 197 |
|
193 | 198 |
if (x,y) == player_screen_pos: |
194 |
- #color = libtcod.Color(128,128,128) |
|
199 |
+ color = libtcod.Color(128,128,100) |
|
195 | 200 |
char = '\x01' |
196 | 201 |
|
197 | 202 |
|