2023-03-13 12:15:43 +00:00
|
|
|
extends Node3D
|
|
|
|
|
|
2023-03-26 22:29:25 +00:00
|
|
|
# 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)
|
2023-03-13 12:15:43 +00:00
|
|
|
|
|
|
|
|
func start():
|
|
|
|
|
$light_animation.play("light_up")
|
|
|
|
|
$AudioPlayer.play("intro")
|
2023-07-11 13:27:44 +00:00
|
|
|
State.pass_stage_to($PlayerController)
|
2023-03-26 22:29:25 +00:00
|
|
|
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")
|
2023-04-22 13:11:10 +00:00
|
|
|
|
2023-03-26 22:29:25 +00:00
|
|
|
return new_mode
|
2023-04-22 13:11:10 +00:00
|
|
|
|
|
|
|
|
func _unhandled_input(event):
|
|
|
|
|
if event is InputEventMouseButton:
|
|
|
|
|
if event.pressed:
|
|
|
|
|
print("passed")
|
2023-07-11 13:27:44 +00:00
|
|
|
#State.pass_stage_to($PlayerController)
|