feat: add juggling gym and animate circus sign
This commit is contained in:
@@ -5,6 +5,8 @@ extends Control
|
||||
signal juggle_requested(focal: Control)
|
||||
signal gym_requested(focal: Control)
|
||||
signal exit_requested
|
||||
signal sign_drop_started
|
||||
signal sign_bounced
|
||||
|
||||
const HOME_BG := preload("res://menus/assets/common/1_sfondo.png")
|
||||
const CLOUDS := preload("res://menus/assets/common/1_nuvole.png")
|
||||
@@ -12,7 +14,7 @@ const BLUE_TENT := preload("res://menus/assets/p1/1_tendone_1.png")
|
||||
const RED_TENT := preload("res://menus/assets/p1/1_tendone_2.png")
|
||||
const BACK_BUTTON := preload("res://menus/assets/common/pulsante_indietro.png")
|
||||
const SETTINGS_BUTTON := preload("res://menus/assets/common/pulsante_rotellina.png")
|
||||
const CIRCUS_SIGN := preload("res://menus/assets/p1/upendi_circus_sign_mockup.png")
|
||||
const CIRCUS_SIGN := preload("res://menus/assets/p1/upendi_circus_sign_static.png")
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -67,4 +69,26 @@ func _add_bottom_bar() -> void:
|
||||
|
||||
|
||||
func _add_sign() -> void:
|
||||
MenuUI.add_image(self, CIRCUS_SIGN, Vector2(0.50, 0.17), Vector2(0.43, 0.34))
|
||||
var sign := TextureRect.new()
|
||||
sign.texture = CIRCUS_SIGN
|
||||
sign.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||
sign.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||
sign.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
add_child(sign)
|
||||
MenuUI.set_normalized_rect(sign, Vector2(0.50, 0.17), Vector2(0.43, 0.34))
|
||||
|
||||
var final_y := sign.position.y
|
||||
sign.position.y = final_y - sign.size.y * 1.15
|
||||
var tween := create_tween()
|
||||
# Il menu viene messo in pausa dalla shell: l'ingresso deve continuare comunque.
|
||||
tween.set_pause_mode(Tween.TWEEN_PAUSE_PROCESS)
|
||||
# Discesa rapida, breve superamento del punto d'arrivo e rimbalzo elastico.
|
||||
call_deferred("_emit_sign_drop_started")
|
||||
tween.tween_property(sign, "position:y", final_y + sign.size.y * 0.04, 1.10).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
|
||||
tween.tween_property(sign, "position:y", final_y, 0.50).set_trans(Tween.TRANS_BOUNCE).set_ease(Tween.EASE_OUT)
|
||||
tween.tween_callback(func(): sign_bounced.emit())
|
||||
|
||||
|
||||
func _emit_sign_drop_started() -> void:
|
||||
if is_inside_tree():
|
||||
sign_drop_started.emit()
|
||||
|
||||
Reference in New Issue
Block a user