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))
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))
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