generated from sakkaku-dev/godot-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
225 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,33 @@ | ||
extends Control | ||
|
||
@export var selectables: Control | ||
@export var select_container: Control | ||
|
||
@onready var bgm := $BGM | ||
@onready var start_sound := $StartSound | ||
|
||
@onready var piece_select := $PieceSelect | ||
@onready var anim := $AnimationPlayer | ||
|
||
func _ready(): | ||
piece_select.hide() | ||
anim.play("RESET") | ||
GameManager.game_started.connect(_on_game_start) | ||
|
||
func _on_game_start(): | ||
selectables.close() | ||
create_tween().tween_property(bgm, "volume_db", -50, 1.0).set_trans(Tween.TRANS_CUBIC) | ||
start_sound.play() | ||
|
||
func _on_play_pressed(): | ||
piece_select.show() | ||
select_container.pivot_offset = select_container.size / 2 | ||
anim.play("show_pieces") | ||
|
||
func _on_check_energy_timer_timeout(): | ||
GameManager.energy.restore() | ||
|
||
func _on_start_pressed(): | ||
GameManager.start_game() | ||
|
||
func _on_piece_select_on_hide(): | ||
anim.play_backwards("show_pieces") | ||
await anim.animation_finished | ||
piece_select.hide() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters