portals yo
This commit is contained in:
1 parent
fa1050d017
commit
366f449d79
13 files changed
+288
-3
No files matched your search
@@ -0,0 +1,28 @@
|
||||
extends Node2D
|
||||
|
||||
@export var paired_teleporter: String
|
||||
var checked_teleport
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("TELEPORTERS")
|
||||
|
||||
func check_for_pair() -> String:
|
||||
print(paired_teleporter)
|
||||
return paired_teleporter
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func _on_contact(body) -> void:
|
||||
#print("PASSED OVER TELEPORTER")
|
||||
#get_tree().call_group("TELEPORTERS","check_for_pair")
|
||||
for teleporter in get_tree().get_nodes_in_group("TELEPORTERS"):
|
||||
print("PAIRED" + str(teleporter))
|
||||
print("SELF" + str(self))
|
||||
if teleporter != self:
|
||||
if %Player2D.teleport_cooldown == 0:
|
||||
body.set_position(teleporter.get_position())
|
||||
%Player2D.teleport_cooldown = 1
|
||||
Reference in new issue
Block a user