Add final progression to tiny sword, fixes and tweeks required

This commit is contained in:
2026-05-15 00:47:38 +02:00
parent 66666defcb
commit 738381a16b
43 changed files with 1127 additions and 339 deletions

View File

@@ -1,13 +1,35 @@
extends Node2D
@onready var _generator_container: GeneratorPanel = $GeneratorContainer
const UNLOCK_GOAL_ID: StringName = &"gold_total_13k"
@onready var _generator_container: GeneratorPanel = $GeneratorContainer
@onready var _sprite: Sprite2D = $Sprite2D
@onready var _area: Area2D = $Area2D
@onready var _game_state: LevelGameState = find_parent("LevelGameState")
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
_generator_container.visible = false
_sprite.visible = false
_area.monitoring = false
_game_state.goal_completed.connect(_on_goal_completed)
if _game_state.is_goal_completed(UNLOCK_GOAL_ID):
_unlock()
func _on_area_2d_mouse_entered() -> void:
_generator_container.visible = true
func _on_area_2d_mouse_exited() -> void:
_generator_container.visible = false
func _on_goal_completed(goal_id: StringName) -> void:
if goal_id == UNLOCK_GOAL_ID:
_unlock()
func _unlock() -> void:
_sprite.visible = true
_area.monitoring = true