TUBES NOW SHOOT UP, A BASKED NOW CATCHES YOU
This commit is contained in:
26
scripts/tube_top.gd
Normal file
26
scripts/tube_top.gd
Normal 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)
|
||||
Reference in New Issue
Block a user