feat: add juggling gym and animate circus sign
This commit is contained in:
@@ -4,6 +4,7 @@ extends Node
|
||||
|
||||
const MAIN_MENU_SCENE := preload("res://menus/scenes/main_menu.tscn")
|
||||
const JUGGLEBOARD_SCENE := preload("res://games/juggleboard/scenes/juggleboard.tscn")
|
||||
const JUGGLING_GYM_SCENE := preload("res://games/juggling_gym/scenes/juggling_gym.tscn")
|
||||
|
||||
var main_menu: MainMenuController
|
||||
var active_game: Node
|
||||
@@ -19,6 +20,7 @@ func _create_menus() -> void:
|
||||
# P2A avvia direttamente Target: il vecchio dialog Target/Infinita non viene
|
||||
# più creato né mostrato.
|
||||
main_menu.mode_requested.connect(_start_juggleboard)
|
||||
main_menu.gym_requested.connect(_start_juggling_gym)
|
||||
main_menu.exit_requested.connect(_exit_app)
|
||||
add_child(main_menu)
|
||||
|
||||
@@ -29,6 +31,10 @@ func _show_debug_target_or_home() -> void:
|
||||
_start_juggleboard()
|
||||
if args.has("--capture-menus"):
|
||||
_capture_game_after_frame()
|
||||
elif args.has("--start-gym"):
|
||||
_start_juggling_gym()
|
||||
if args.has("--capture-menus"):
|
||||
_capture_gym_after_frame()
|
||||
elif args.has("--capture-mode-dialog"):
|
||||
# Compatibilità del flag di debug: il dialog non fa più parte del flusso.
|
||||
main_menu.show_juggle()
|
||||
@@ -47,6 +53,13 @@ func _return_to_juggle_menu() -> void:
|
||||
main_menu.show_juggle()
|
||||
|
||||
|
||||
func _return_to_gym_menu() -> void:
|
||||
if is_instance_valid(active_game):
|
||||
active_game.queue_free()
|
||||
active_game = null
|
||||
main_menu.show_gym()
|
||||
|
||||
|
||||
func _start_juggleboard() -> void:
|
||||
main_menu.hide_menu()
|
||||
if is_instance_valid(active_game):
|
||||
@@ -56,11 +69,25 @@ func _start_juggleboard() -> void:
|
||||
add_child(active_game)
|
||||
|
||||
|
||||
func _start_juggling_gym() -> void:
|
||||
main_menu.hide_menu()
|
||||
if is_instance_valid(active_game):
|
||||
active_game.queue_free()
|
||||
active_game = JUGGLING_GYM_SCENE.instantiate()
|
||||
active_game.return_requested.connect(_return_to_gym_menu)
|
||||
add_child(active_game)
|
||||
|
||||
|
||||
func _capture_game_after_frame() -> void:
|
||||
await RenderingServer.frame_post_draw
|
||||
get_viewport().get_texture().get_image().save_png("/tmp/autgame_juggleboard.png")
|
||||
|
||||
|
||||
func _capture_gym_after_frame() -> void:
|
||||
await RenderingServer.frame_post_draw
|
||||
get_viewport().get_texture().get_image().save_png("/tmp/autgame_juggling_gym.png")
|
||||
|
||||
|
||||
func _exit_app() -> void:
|
||||
if not OS.has_feature("web"):
|
||||
get_tree().quit()
|
||||
|
||||
Reference in New Issue
Block a user