42 lines
942 B
Python
42 lines
942 B
Python
import numpy as np
|
|
|
|
import colors
|
|
|
|
#nympy datatypes
|
|
graphics_dt = np.dtype(
|
|
[
|
|
("ch", np.int32),
|
|
("fg", "3B"),
|
|
("bg", "3B"),
|
|
]
|
|
)
|
|
|
|
tile_dt = np.dtype(
|
|
[
|
|
("walkable", np.bool),
|
|
("transparent", np.bool),
|
|
("light", graphics_dt), #when this tile is in FOV
|
|
("dark", graphics_dt), #when this tile *was* in FOV
|
|
]
|
|
)
|
|
|
|
def new_tile(*, walkable: np.bool, transparent: np.bool, light: graphics_dt, dark: graphics_dt): # type: ignore
|
|
return np.array((walkable, transparent, light, dark), dtype = tile_dt)
|
|
|
|
#list of tile types
|
|
SHROUD = np.array((ord(" "), colors.white, colors.black), dtype=graphics_dt)
|
|
|
|
wall = new_tile(
|
|
walkable=False,
|
|
transparent=False,
|
|
light=(ord('#'), colors.terminal_light, colors.black),
|
|
dark =(ord('#'), colors.terminal_dark, colors.black),
|
|
)
|
|
|
|
floor = new_tile(
|
|
walkable=True,
|
|
transparent=True,
|
|
light=(ord('.'), colors.terminal_light, colors.black),
|
|
dark =(ord('.'), colors.terminal_dark, colors.black),
|
|
)
|