Fill the map with Empty tiles instead of Wall tiles

This commit is contained in:
Eryn Wells 2022-05-03 19:03:31 -07:00
parent fcfab9fc1b
commit 7c5c3c57ec
2 changed files with 3 additions and 2 deletions

View file

@ -6,7 +6,7 @@ import numpy as np
import random
import tcod
from .geometry import Point, Rect, Size
from .tile import Floor, Wall
from .tile import Empty, Floor, Wall
from typing import List, Optional
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,
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
rooms: List['RectangularRoom'] = []

View file

@ -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:
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)))
Wall = tile(walkable=False, transparent=False, dark=(ord(' '), (255, 255, 255), (0, 0, 150)))