From 5be7a61e56560fe50a7ba0a51bf125dd3217723f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20N=C3=B6llemeyer?= Date: Sat, 17 Aug 2024 20:31:32 +0200 Subject: [PATCH] fixed last commit --- game/screens/game_screens.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/game/screens/game_screens.py b/game/screens/game_screens.py index 299f983..ddea154 100644 --- a/game/screens/game_screens.py +++ b/game/screens/game_screens.py @@ -99,11 +99,17 @@ class MainScreen(Screen): console.rgb[["ch", "fg"]][screen_pos.y + h, screen_pos.x + w] = graphic.ch, graphic.fg # Draw walls - doors = [ d.components[Position] for d in g.world.Q.all_of(tags=[IsDoor]) ] + doors = [ world_pos_to_map_pos(d.components[Position]) for d in g.world.Q.all_of(tags=[IsDoor]) ] for (y, row) in enumerate(map.walkable): for (x, val) in enumerate(row): pos = map_pos_to_world_pos(Position(x,y)) - graphic = Graphic(0 if val else WALL_CHAR if (map.walkable[y+1,x] and Position(x ,y+1) in doors) else VERTICAL_WALL_CHAR) + ch = 0 + if not val: + ch = VERTICAL_WALL_CHAR + in_doors = Position(x,y+1) in doors + if map.walkable[y+1,x] and not in_doors: + ch = WALL_CHAR + graphic = Graphic(ch) draw(pos, graphic) # draw all entities that are not actors for entity in g.world.Q.all_of(components=[Position, Graphic]).none_of(tags=[IsActor]):