3 from naja.constants import BITS
6 def convert_colour(colour):
7 if isinstance(colour, pygame.Color):
9 if isinstance(colour, tuple):
10 return pygame.Color(*colour)
11 if isinstance(colour, basestring):
12 return pygame.Color(colour)
17 bit_names = dict((v, k) for k, v in BITS.items())
18 return '{%s}' % ','.join(bit_names[bit] for bit in reversed(range(8))
22 def move_glyph(move_name):
27 }.get(move_name, move_name.lower())
30 def warp_to_game_state(game_state):
31 from naja.events import LoadGameEvent, SceneChangeEvent
32 from naja.scenes.game import GameScene
33 LoadGameEvent.post(game_state)
34 SceneChangeEvent.post(GameScene)