WIP: Streamline Interiors System #16

Draft
kayomn wants to merge 6 commits from interiors-overhaul into main
3 changed files with 12 additions and 9 deletions
Showing only changes of commit 200f0939c3 - Show all commits

Binary file not shown.

View File

@ -95,15 +95,18 @@ class Chunk:
# Find floor tile types.
for y in _CHUNK_SIZE:
for x in _CHUNK_SIZE:
if floor_map.get_bitv(offset + Vector2i(x, y)):
var map_area := Rect2i(Vector2.ZERO, map_size)
var map_coordinates := offset + Vector2i(x, y)
if map_area.has_point(map_coordinates) and floor_map.get_bitv(map_coordinates):
var tile := 0
for i in Orientation.values().size():
var delta_x := roundi(cos(i * PI / 2.0))
var delta_y := roundi(sin(i * PI / 2.0))
var map_neighbor := map_coordinates + Vector2i(
roundi(cos(i * PI / 2.0)), roundi(sin(i * PI / 2.0)))
if (0 <= (y + int(delta_y < map_size.y))) and (0 <= (x + int(delta_x < map_size.x))):
tile += int(floor_map.get_bit(x + delta_x, y + delta_y)) * 2 ** i
if map_area.has_point(map_neighbor):
tile += int(floor_map.get_bitv(map_neighbor)) * 2 ** i
positions_by_floor_tile[tile].append(Vector2(x, y))

BIN
map_editor.scn (Stored with Git LFS)

Binary file not shown.