extends Node

## Autoload Demo: Scene B

func _ready():
	# Retrieve the actual score from the Global singleton
	$Label.text = "Counter (Scene B): %d" % Global.current_score
	
	$IncrementBtn.pressed.connect(_on_increment)
	$ChangeSceneBtn.pressed.connect(_on_change_scene)

func _on_increment():
	# Modifying the SAME global variable
	Global.current_score += 1
	$Label.text = "Counter (Scene B): %d" % Global.current_score

func _on_change_scene():
	get_tree().change_scene_to_file("res://scenes/lecture/autoload_demo.tscn")
