From e3dfc649d415470e86ac4f7ae397dcd93af2f267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20N=C3=B6llemeyer?= Date: Mon, 19 Aug 2024 20:19:33 +0200 Subject: [PATCH] fixed doors --- game/screens/game_screens.py | 2 +- game/screens/menus.py | 3 ++- game/tilesetmanager.py | 7 +------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/game/screens/game_screens.py b/game/screens/game_screens.py index fea1bb1..159dede 100644 --- a/game/screens/game_screens.py +++ b/game/screens/game_screens.py @@ -109,7 +109,7 @@ class MainScreen(Screen): 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: + if walkable or world_pos in doors: console.rgba[["ch","fg"]][j, i] = FLOOR_CHAR, (70,70,70, 255) continue ch = VERTICAL_WALL_CHAR diff --git a/game/screens/menus.py b/game/screens/menus.py index 2e707e1..66343ff 100644 --- a/game/screens/menus.py +++ b/game/screens/menus.py @@ -47,7 +47,8 @@ class SelectItem(MenuItem): def on_draw(self, console: tcod.console.Console, x: int, y: int, highlight: bool) -> None: """Render this items label.""" - console.print(x, y, self.label, fg=(255, 255, 255), bg=(64, 64, 64) if highlight else (0, 0, 0)) + #g.foreground.print(x, y, self.label, fg=(255, 255, 255), bg=(64, 64, 64) if highlight else (0, 0, 0)) + g.background.print(x, y, self.label, fg=(255, 255, 255), bg=(64, 64, 64) if highlight else (0, 0, 0)) @attrs.define() diff --git a/game/tilesetmanager.py b/game/tilesetmanager.py index 2203abd..92c94b9 100644 --- a/game/tilesetmanager.py +++ b/game/tilesetmanager.py @@ -18,17 +18,12 @@ def valid_tileset(): "Oryx/oryx_roguelike_2.0/Terrain.png", columns=16, rows=11, charmap=[i for i in range(255)] ) - player = monstertiles.get_tile(1) - player = [[[r,g,b,a] if a > 0 else [0,0,0,0] - for r,g,b,a in row] - for row in player] - tileset.set_tile(ord('@'), player) + tileset.set_tile(ord('@'), monstertiles.get_tile(1)) tileset.set_tile(ord('/'), terraintiles.get_tile(ord('?'))) tileset.set_tile(ord('|'), terraintiles.get_tile(ord('!'))) tileset.set_tile(ord('_'), terraintiles.get_tile(ord('0'))) tileset.set_tile(ord('\\'), terraintiles.get_tile(ord('/'))) tileset.set_tile(ord('.'), terraintiles.get_tile(20)) tileset.set_tile(ord(','), terraintiles.get_tile(12)) - print(tileset.get_tile(ord('@'))[10]) return tileset