diff --git a/game/states.py b/game/states.py index 3d30a08..22a14a9 100644 --- a/game/states.py +++ b/game/states.py @@ -54,14 +54,14 @@ class InGame(State): centers = g.world.Q.all_of(tags=[IsPlayer]) centers = list(map(lambda a: a.components[Position], centers)) center = reduce(lambda a,b: a.components[Position]+b.components[Position], centers) - center.mod(len(centers)) + center = center.mod(len(centers)) def draw(e): - pos = Position(console.width//2, console.height//2) + center - e.components[Position] + pos = e.components[Position] - center if (-console.width//2 <= pos.x < console.width//2\ and -console.height//2 <= pos.y < console.height//2): graphic = e.components[Graphic] - console.rgb[["ch", "fg"]][pos.y, pos.x] = graphic.ch, graphic.fg + console.rgb[["ch", "fg"]][pos.y + console.height//2, pos.x + console.width//2] = graphic.ch, graphic.fg for entity in g.world.Q.all_of(components=[Position, Graphic]).none_of(tags=[IsActor]): draw(entity)