X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D?a=blobdiff_plain;f=new%2Fplomrogue%2Fgame.py;h=13b40024cf3909eda619367af5b034aaf9b2c046;hb=1fbd3687acb5edcdf043abfed92ec022d342f807;hp=6b2c74b62f7427e9ae4daa9e705e0f740f16745e;hpb=b7587718cee2308bd2a27462e0996dc279bd3038;p=plomrogue2-experiments diff --git a/new/plomrogue/game.py b/new/plomrogue/game.py index 6b2c74b..13b4002 100755 --- a/new/plomrogue/game.py +++ b/new/plomrogue/game.py @@ -105,22 +105,22 @@ class Game(GameBase): def send_gamestate(self, connection_id=None): """Send out game state data relevant to clients.""" - def send_thing(offset, thing): - offset_pos = self.map_geometry.pos_in_projection(thing.position, - offset, - self.map_size) + def send_thing(thing): + view_pos = self.map_geometry.pos_in_view(thing.position, + self.player.view_offset, + self.map_size) self.io.send('THING_TYPE %s %s' % (thing.id_, thing.type_)) - self.io.send('THING_POS %s %s' % (thing.id_, offset_pos)) + self.io.send('THING_POS %s %s' % (thing.id_, view_pos)) self.io.send('TURN ' + str(self.turn)) visible_map = self.player.get_visible_map() - offset = self.player.get_surroundings_offset() - self.io.send('VISIBLE_MAP %s %s' % (offset, visible_map.size)) + self.io.send('VISIBLE_MAP %s %s' % (visible_map.size, + visible_map.start_indented)) for y, line in visible_map.lines(): self.io.send('VISIBLE_MAP_LINE %5s %s' % (y, quote(line))) visible_things = self.player.get_visible_things() for thing in visible_things: - send_thing(offset, thing) + send_thing(thing) if hasattr(thing, 'health'): self.io.send('THING_HEALTH %s %s' % (thing.id_, thing.health)) @@ -131,7 +131,7 @@ class Game(GameBase): self.io.send('PLAYER_INVENTORY ,') for id_ in self.player.inventory: thing = self.get_thing(id_) - send_thing(offset, thing) + send_thing(thing) self.io.send('GAME_STATE_COMPLETE') def proceed(self):