Fill the map with Empty tiles instead of Wall tiles
This commit is contained in:
parent
fcfab9fc1b
commit
7c5c3c57ec
2 changed files with 3 additions and 2 deletions
|
@ -6,7 +6,7 @@ import numpy as np
|
||||||
import random
|
import random
|
||||||
import tcod
|
import tcod
|
||||||
from .geometry import Point, Rect, Size
|
from .geometry import Point, Rect, Size
|
||||||
from .tile import Floor, Wall
|
from .tile import Empty, Floor, Wall
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
LOG = logging.getLogger('map')
|
LOG = logging.getLogger('map')
|
||||||
|
@ -86,7 +86,7 @@ class RoomsAndCorridorsGenerator(MapGenerator):
|
||||||
min_width=minimum_room_size.width + 2, min_height=minimum_room_size.height + 2,
|
min_width=minimum_room_size.width + 2, min_height=minimum_room_size.height + 2,
|
||||||
max_horizontal_ratio=1.5, max_vertical_ratio=1.5)
|
max_horizontal_ratio=1.5, max_vertical_ratio=1.5)
|
||||||
|
|
||||||
tiles = np.full(tuple(self.size), fill_value=Wall, order='F')
|
tiles = np.full(tuple(self.size), fill_value=Empty, order='F')
|
||||||
|
|
||||||
# Generate the rooms
|
# Generate the rooms
|
||||||
rooms: List['RectangularRoom'] = []
|
rooms: List['RectangularRoom'] = []
|
||||||
|
|
|
@ -25,5 +25,6 @@ tile_datatype = np.dtype([
|
||||||
def tile(*, walkable: int, transparent: int, dark: Tuple[int, Tuple[int, int, int], Tuple[int, int ,int]]) -> np.ndarray:
|
def tile(*, walkable: int, transparent: int, dark: Tuple[int, Tuple[int, int, int], Tuple[int, int ,int]]) -> np.ndarray:
|
||||||
return np.array((walkable, transparent, dark), dtype=tile_datatype)
|
return np.array((walkable, transparent, dark), dtype=tile_datatype)
|
||||||
|
|
||||||
|
Empty = tile(walkable=False, transparent=False, dark=(ord(' '), (255, 255, 255), (0, 0, 0)))
|
||||||
Floor = tile(walkable=True, transparent=True, dark=(ord(' '), (255, 255, 255), (50, 50, 150)))
|
Floor = tile(walkable=True, transparent=True, dark=(ord(' '), (255, 255, 255), (50, 50, 150)))
|
||||||
Wall = tile(walkable=False, transparent=False, dark=(ord(' '), (255, 255, 255), (0, 0, 150)))
|
Wall = tile(walkable=False, transparent=False, dark=(ord(' '), (255, 255, 255), (0, 0, 150)))
|
Loading…
Add table
Add a link
Reference in a new issue