Rename portals
This commit is contained in:
1 parent
cec098923b
commit
b125c479fe
3 files changed
+20
-18
No files matched your search
@@ -1,7 +1,7 @@
|
||||
extends Node3D
|
||||
|
||||
@onready var entry_portal: Portal3D = %EntryPortal
|
||||
@onready var win_portal: Portal3D = %WinPortal
|
||||
@onready var stairs_portal: Portal3D = %StairsPortal
|
||||
@onready var start_portal: Portal3D = %StartPortal
|
||||
@onready var blue_portal: Portal3D = %BluePortal
|
||||
@onready var red_portal: Portal3D = %RedPortal
|
||||
|
||||
@@ -15,15 +15,15 @@ func _ready() -> void:
|
||||
|
||||
func _on_blue_portal_on_teleport(node: Node3D) -> void:
|
||||
blue_completed = true
|
||||
entry_portal.exit_portal = blue_portal
|
||||
stairs_portal.exit_portal = blue_portal
|
||||
check_completion()
|
||||
|
||||
func _on_red_portal_on_teleport(node: Node3D) -> void:
|
||||
red_completed = true
|
||||
entry_portal.exit_portal = red_portal
|
||||
stairs_portal.exit_portal = red_portal
|
||||
check_completion()
|
||||
|
||||
func check_completion() -> void:
|
||||
if blue_completed and red_completed:
|
||||
entry_portal.exit_portal = win_portal
|
||||
stairs_portal.exit_portal = start_portal
|
||||
win_indicator.visible = true
|
||||
Reference in new issue
Block a user