extends Area2D
class_name BellowBridgeArea


func _on_body_entered(_body: Node2D) -> void:
	if _body is BaseCharacter:
		var bridge: TileMapLayer = self.get_parent()
		bridge.z_index = 2
		_body.set_collision_layer_value(4, false)
		_body.set_collision_mask_value(4, false)
		print("entering bellow bridge")

func _on_body_exited(_body: Node2D) -> void:
	if _body is BaseCharacter:
		var bridge: TileMapLayer = self.get_parent()
		bridge.z_index = 0
		_body.set_collision_layer_value(4, true)
		_body.set_collision_mask_value(4, true)
		print("exiting bellow bridge")
