- commit
- 56a1dd78d676155075da4e85bec8a1bae504661f
- parent
- 03920ab22fa44fafeea35168858f6c6f8e6e750f
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2014-11-01 10:42
render map on connection
Diffstat
| M | laneya/client.py | 10 | ++++++++++ |
1 files changed, 10 insertions, 0 deletions
diff --git a/laneya/client.py b/laneya/client.py
@@ -16,6 +16,16 @@ class Client(protocol.ClientProtocolFactory): 16 16 protocol.ClientProtocolFactory.__init__(self) 17 17 self.sprites = {} 18 18 -1 19 def connectionMade(self): -1 20 self.sendRequest('get_map', map_id='example_map')\ -1 21 .then(lambda response: self.render_floor(response['data'])) -1 22 -1 23 def render_floor(self, data): -1 24 for x, column in enumerate(data['floor_layer']): -1 25 for y, field in enumerate(column): -1 26 if field == 'wall': -1 27 screen.putstr(y, x, '#') -1 28 19 29 def updateReceived(self, action, **kwargs): # TODO 20 30 if action == 'position': 21 31 entity = kwargs['entity']