From cbd634a8dcd32935a8c3d0f70c07b9a52f9c4e17 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 18 Apr 2013 13:55:13 +0200 Subject: [PATCH] Remove debugging prints. Add get_data method for saving --- erdslangetjie/level.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/erdslangetjie/level.py b/erdslangetjie/level.py index 73878aa..4f8059e 100644 --- a/erdslangetjie/level.py +++ b/erdslangetjie/level.py @@ -93,11 +93,7 @@ class Level(object): return self._data[pos[1]][pos[0]] def set_tile_type(self, pos, new_type): - print '\n'.join([''.join(x) for x in self._data]) self._data[pos[1]][pos[0]] = new_type - print - print '\n'.join([''.join(x) for x in self._data]) - print pos, self._in_limits(pos) new_tile = self._get_tile_image(pos, new_type) self._tiles[pos[1]][pos[0]] = new_tile self._changed.append((pos, new_tile)) @@ -109,7 +105,6 @@ class Level(object): if not self._in_limits(new_pos): continue tile = self._data[new_pos[1]][new_pos[0]] - print new_pos, tile new_tile = self._get_tile_image(new_pos, tile) self._tiles[new_pos[1]][new_pos[0]] = new_tile self._changed.append((new_pos, new_tile)) @@ -120,6 +115,9 @@ class Level(object): def at_exit(self, pos): return pos in self.exit_pos + def get_level_data(self): + return '\n'.join(reversed([''.join(x) for x in self._data])) + def _get_wall_tile(self, pos): # Is the neighbour in this direction also a wall? x, y = pos -- 2.34.1