Glowing crystals mainly
This commit is contained in:
parent
ce0ef75241
commit
49e344f109
8 changed files with 624 additions and 188 deletions
|
|
@ -5,7 +5,6 @@ var astar : AStarGrid2D = AStarGrid2D.new()
|
|||
@onready var fog_overlay : ColorRect = $FogOverlay
|
||||
@onready var mushroom_glow_container : Node2D = $MushroomGlowContainer
|
||||
|
||||
|
||||
@onready var tilemap_size : Vector2i = get_used_rect().end - get_used_rect().position
|
||||
@onready var map_rect : Rect2i = Rect2i(Vector2i.ZERO, tilemap_size)
|
||||
|
||||
|
|
@ -46,12 +45,17 @@ func update_passable() -> void:
|
|||
for i in tilemap_size.x:
|
||||
for j in tilemap_size.y:
|
||||
var coords : Vector2i = Vector2i(i, j)
|
||||
var tile_data : TileData = get_cell_tile_data(0, coords)
|
||||
var tile_data : TileData = get_cell_tile_data(get_layer_id_by_name('Floor'), coords)
|
||||
if tile_data and tile_data.get_custom_data('navtype') == 'wall':
|
||||
astar.set_point_solid(coords)
|
||||
else:
|
||||
astar.set_point_solid(coords, false)
|
||||
continue
|
||||
|
||||
tile_data = get_cell_tile_data(get_layer_id_by_name('Water'), coords)
|
||||
if tile_data and tile_data.get_custom_data('navtype') == 'water':
|
||||
astar.set_point_solid(coords)
|
||||
continue
|
||||
|
||||
astar.set_point_solid(coords, false)
|
||||
pass
|
||||
|
||||
func is_point_walkable(check_position : Vector2i) -> bool:
|
||||
|
|
@ -108,7 +112,7 @@ func filter_indestructible_tiles(coords : Array) -> Array:
|
|||
return filtered_coords
|
||||
|
||||
func check_for_visible_gatherables() -> void:
|
||||
|
||||
return
|
||||
# Remove all existing glowing lights
|
||||
for child in mushroom_glow_container.get_children():
|
||||
child.queue_free()
|
||||
|
|
@ -132,3 +136,9 @@ func check_for_visible_gatherables() -> void:
|
|||
glow.colour_name = glow_colour
|
||||
mushroom_glow_container.add_child.call_deferred(glow)
|
||||
|
||||
func get_layer_id_by_name(level_name : String) -> int:
|
||||
var layers : int = get_layers_count()
|
||||
for i in layers:
|
||||
if get_layer_name(i) == level_name:
|
||||
return i
|
||||
return -1
|
||||
Loading…
Add table
Add a link
Reference in a new issue