fixed last commit
This commit is contained in:
parent
675e4a6af7
commit
5be7a61e56
1 changed files with 8 additions and 2 deletions
|
|
@ -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]):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue