added states to room handle, may get depricated

This commit is contained in:
betalars 2023-03-27 00:29:25 +02:00
parent f29abf03b8
commit 16b4c36f26
1 changed files with 28 additions and 2 deletions

View File

@ -1,16 +1,42 @@
extends Node3D extends Node3D
# Referencing the current State of the Scene.
enum Modes {
FREEZE,
WALKING,
COLLECTING,
LISTENING,
SORTING
}
signal freeze
signal unfreeze
var current_mode: int = Modes.FREEZE:
set(new_mode):
if not current_mode == new_mode:
current_mode = _update_scene(new_mode)
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
pass # Replace with function body. pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta): func _process(delta):
pass pass
func start(): func start():
$PlayerController.active = true
$light_animation.play("light_up") $light_animation.play("light_up")
$AudioPlayer.play("intro") $AudioPlayer.play("intro")
$PlayerController.active = true
current_mode = Modes.WALKING
func _update_scene(new_mode) -> int:
if current_mode == Modes.FREEZE:
emit_signal("freeze")
elif new_mode == Modes.FREEZE:
emit_signal("freeze")
return new_mode