Fixes highlight for the frog minigame

This commit is contained in:
Dylan Sarrazyn
2024-04-23 15:00:26 +02:00
committed by BimDav
parent 81ad9bcbeb
commit d9a7899743
9 changed files with 27 additions and 12 deletions
Binary file not shown.
Binary file not shown.
+1 -9
View File
@@ -2,15 +2,7 @@
importer="csv_translation"
type="Translation"
<<<<<<< HEAD
<<<<<<< HEAD
uid="uid://dh6pc6oshep4t"
=======
uid="uid://4yf2petk28t8"
>>>>>>> 75bb22e1 (Adds commentary to the jellyfish minigame. Reworks the jellyfish pressed interaction. Corrects the stimuli and distractions. Adds the highlight fx to the jellyfishes)
=======
uid="uid://bqpoj7ltdn8ub"
>>>>>>> ebb4f288 (Adds the hear and sequentials steps minigame scene. Initial setup for the caterpillar minigame. Adds all the assets for the caterpillar minigame.)
uid="uid://85j5le7ampg"
[deps]
+4 -1
View File
@@ -44,7 +44,9 @@ func _setup_word_progression() -> void:
func _highlight() -> void:
for track: LilypadTrack in lilypad_tracks_container.get_children():
track.is_highlighting = true
if track.is_enabled:
track.is_highlighting = true
break
func _reset_frog() -> void:
@@ -118,6 +120,7 @@ func _on_track_lilypad_in_center(lilypad: Lilypad, track: LilypadTrack) -> void:
await _reset_frog()
else:
track.stop()
track.is_highlighting = false
track.is_cleared = true
await audio_player.play_phoneme(lilypad.stimulus.Phoneme)
current_word_progression += 1
+1 -2
View File
@@ -128,13 +128,12 @@ func _despawn_lilypad(lilypad: Lilypad) -> void:
func _set_enabled(value: bool) -> void:
is_enabled = value
for lilypad in lilypads:
lilypad.disabled = not is_enabled
func _set_highlighting(value: bool) -> void:
is_highlighting = value
is_highlighting = is_enabled and value
for lilypad in lilypads:
if is_highlighting:
lilypad.highlight()
+1
View File
@@ -9,6 +9,7 @@
script = ExtResource("1_yojn5")
[node name="HighlightFX" parent="." instance=ExtResource("2_8nuxj")]
scale = Vector2(0.5, 0.5)
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(2, 2)
+8
View File
@@ -64,6 +64,14 @@ func hit(p_coconut: Coconut) -> void:
stunned = true
func highlight() -> void:
coconut.highlight_fx.play()
func stop_highlight() -> void:
coconut.highlight_fx.stop()
func _on_animation_player_animation_finished(anim_name: StringName) -> void:
if anim_name == "idle":
if randf() < 0.25:
@@ -81,6 +81,12 @@ func _setup_minigame() -> void:
_reset_plank_label()
func _highlight() -> void:
for monkey: Monkey in monkeys:
if _is_GP_right(monkey.stimulus):
monkey.highlight()
func _reset_plank_label() -> void:
word_label.text = "_".repeat(_get_current_stimulus().Word.length())
@@ -98,6 +104,9 @@ func _play_monkey_stimulus(monkey: Monkey) -> void:
func _get_coconut_from_monkey_to_king(monkey: Monkey) -> Node2D:
monkey.stop_highlight()
await monkey.play("start_throw")
monkey.play("finish_throw")
+3
View File
@@ -76,6 +76,7 @@ tracks/5/keys = {
[sub_resource type="Animation" id="Animation_ud7pl"]
resource_name = "win"
length = 3.0
loop_mode = 1
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
@@ -243,3 +244,5 @@ texture = ExtResource("1_s57yc")
modulate = Color(1, 1, 1, 0)
scale = Vector2(0.8, 0.8)
texture = ExtResource("2_3sm6p")
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"]