feat: add a secret wall on a separate layer with toggleable visibility and collision;
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
|||||||
|
extends TileMapLayer
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
disable_secret_door()
|
||||||
|
|
||||||
|
func disable_secret_door():
|
||||||
|
visible = false
|
||||||
|
collision_enabled = false
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://dma58qu1o08h7
|
||||||
@@ -51,10 +51,8 @@ func push_blocks():
|
|||||||
func _on_area_2d_body_entered(body: Node2D) -> void:
|
func _on_area_2d_body_entered(body: Node2D) -> void:
|
||||||
if body.is_in_group("interactable"):
|
if body.is_in_group("interactable"):
|
||||||
body.can_interact = true
|
body.can_interact = true
|
||||||
print("Able to intreact!")
|
|
||||||
|
|
||||||
|
|
||||||
func _on_area_2d_body_exited(body: Node2D) -> void:
|
func _on_area_2d_body_exited(body: Node2D) -> void:
|
||||||
if body.is_in_group("interactable"):
|
if body.is_in_group("interactable"):
|
||||||
body.can_interact = false
|
body.can_interact = false
|
||||||
print("Left interactable!")
|
|
||||||
|
|||||||
Reference in New Issue
Block a user