keine ahnung...

This commit is contained in:
staubsauger 2024-08-19 15:47:27 +02:00
parent 64e4e4f437
commit 68aa90cac8
4 changed files with 10 additions and 8 deletions

View file

@ -62,7 +62,7 @@ def _draw_entity(entity: tcod.ecs.Entity, camera_pos, camera_radius_x, camera_ra
map_pos = world_pos_to_map_pos(pos)
if g.world[None].components[Map].fov[map_pos.y, map_pos.x]:
graphic = entity.components[Graphic]
g.foreground.rgb[["ch", "fg"]][screen_pos.y + camera_radius_y, screen_pos.x + camera_radius_x] = graphic.ch, graphic.fg
g.foreground.rgba[["ch", "fg", "bg"]][screen_pos.y + camera_radius_y, screen_pos.x + camera_radius_x] = graphic.ch, graphic.fg, graphic.bg
@attrs.define()
@ -105,16 +105,16 @@ class MainScreen(Screen):
in_map = 0 <= map_pos.x < map.width and 0 <= map_pos.y < map.height
in_fov = in_map and map.fov[map_pos.y,map_pos.x]
if not in_fov:
console.rgb[["ch","fg"]][j, i] = 0x2591, (50,50,50)
console.rgba[["ch","fg"]][j, i] = 0x2591, (50,50,50, 255)
continue
walkable = (not in_map) or map.walkable[map_pos.y, map_pos.x]
if walkable:
console.rgb[["ch","fg"]][j, i] = FLOOR_CHAR, (70,70,70)
console.rgba[["ch","fg"]][j, i] = FLOOR_CHAR, (70,70,70, 255)
continue
ch = VERTICAL_WALL_CHAR
if map.walkable[map_pos.y+1, map_pos.x] and world_pos+Position(0,1) not in doors:
ch = WALL_CHAR
console.rgb[["ch","fg"]][j, i] = ch, (255,255,255)
console.rgba[["ch","fg"]][j, i] = ch, (255,255,255, 255)
# draw all entities that are not actors
for entity in g.world.Q.all_of(components=[Position, Graphic]).none_of(tags=[IsActor]):