TUBES NOW SHOOT UP, A BASKED NOW CATCHES YOU

This commit is contained in:
Derek
2025-03-30 18:44:54 -05:00
parent 757b2df6b3
commit e1ac78d927
17 changed files with 461 additions and 116 deletions

View File

@@ -3,32 +3,30 @@ class_name Portal
var level_info = {}
var timer_active = false
var active = true
var entered = false
var index : int
@onready var timer: Timer = $Timer
@onready var scene_holder: Node3D = $Scene_Holder
const SCENE_SPAWN_OFFSET = Vector3(0,400,0)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_body_entered(body: Node3D) -> void:
if body.is_in_group("player"):
if active and timer_active:
if body is Player:
if active and !entered:
active = false
timer.start(1)
var scene = load(level_info["level_path"]).instantiate()
get_tree().current_scene.add_child(scene)
scene_holder.add_child(scene)
scene.global_position = global_position + SCENE_SPAWN_OFFSET
entered = true
if active and entered:
var spawned_stuff = scene_holder.get_children()
for i in spawned_stuff:
i.queue_free()
func _on_start_activation_timeout() -> void:
timer_active = true
active = true