goose_talk function now passes index_frame attribute to set which phrase

will display from the spritesheet.
This commit is contained in:
Henry 2026-02-13 14:30:35 +00:00
parent e3c384c3cd
commit 462b0fc4b0
7 changed files with 16 additions and 13 deletions

View file

@ -8,6 +8,6 @@ signal enemy_died()
signal enemy_hit(value: int)
signal initialize_shieldbar()
signal start_game()
signal goose_talk()
signal goose_talk(frame_index: int)
@warning_ignore_restore("unused_signal") # put any future signals you add between the two ignore annotations

View file

@ -5,18 +5,18 @@ func _ready() -> void:
EventBus.goose_talk.connect(_on_goose_talk)
func _on_goose_talk():
func _on_goose_talk(frame_index: int):
print("QUACK")
self.show()
self.show()
$DapperGoose/Bubble.set_frame(frame_index)
var tween = create_tween()
tween.tween_property(self, "position:x", position.x - 50, .5).set_ease(tween.EASE_OUT)
await tween.finished
$DapperGoose/Bubble.show()
await get_tree().create_timer(3).timeout
$DapperGoose/Bubble.hide()
tween = create_tween()
tween.tween_property(self, "position:x", position.x + 50, .5).set_ease(tween.EASE_IN)
await tween.finished
self.hide()

View file

@ -14,9 +14,9 @@ script = ExtResource("1_wf0t2")
texture = ExtResource("1_wo8sg")
[node name="Bubble" type="Sprite2D" parent="DapperGoose" unique_id=2012258473]
visible = false
position = Vector2(-108, -21)
texture = ExtResource("3_g7ad0")
hframes = 3
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1718121082]
position = Vector2(-18.5, 1)

View file

@ -104,16 +104,20 @@ func new_game():
# Tell the shield to recharge.
# EventBus.initialize_shieldbar.emit()
# await EventBus.initialize_shieldbar
# instantiate the Player
# await get_tree().create_timer(1).timeout
instance = player.instantiate()
add_child(instance)
$Player.start()
# Do some DapperGoose talk
await get_tree().create_timer(1.5).timeout
EventBus.goose_talk.emit(2)
# Tell the enemies to spawn!
#await get_tree().create_timer(.5).timeout
$Wave.spawn_enemies()
$Wave.spawn_enemies()
# Tell the game we're playing.

View file

@ -42,7 +42,7 @@ func start():
$Ship.show()
position = Vector2(screensize.x / 2, screensize.y)
var tween = create_tween()
tween.tween_property(self, "position:y", 48 * -1, .75).as_relative()
tween.tween_property(self, "position:y", 120 * -1, 1).as_relative()
await tween.finished
$GunCooldown.wait_time = cooldown
set_shield(max_shield)