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

26
scripts/tube_top.gd Normal file
View File

@@ -0,0 +1,26 @@
extends Node3D
@export var level_bounds : LevelBounds
var open = true
var active = true
@onready var anim_player: AnimationPlayer = $AnimationPlayer
func _on_player_detect_body_entered(body: Node3D) -> void:
if body is Player:
if open and active:
anim_player.play("close")
open = false
func _on_switch_1_switch_changed() -> void:
if open:
anim_player.play("close")
open = false
else:
anim_player.play("open")
open = true
if level_bounds != null:
level_bounds.toggle_collision(!open)