diff --git a/sources/minigames/frog/frog_minigame.tscn b/sources/minigames/frog/frog_minigame.tscn index a06cf916..078c7b90 100644 --- a/sources/minigames/frog/frog_minigame.tscn +++ b/sources/minigames/frog/frog_minigame.tscn @@ -20,7 +20,8 @@ max_number_of_GPs = 6 distractors_queue_size = 6 time_between_words = 3.0 minigame_name = 5 -lesson_nb = 6 +lesson_nb = 26 +difficulty = 4 max_number_of_lives = 5 max_progression = 5 diff --git a/sources/minigames/frog/lilypad.gd b/sources/minigames/frog/lilypad.gd index 8b4de536..d3fe5aef 100644 --- a/sources/minigames/frog/lilypad.gd +++ b/sources/minigames/frog/lilypad.gd @@ -15,9 +15,11 @@ var stimulus: Dictionary: var disabled: = false: set = _set_disabled var is_distractor: = true +var top_to_bottom: = false func disappear() -> void: + button.disabled = true animation_player.play("disappear") @@ -65,5 +67,11 @@ func _on_texture_button_pressed() -> void: pressed.emit() -func _on_visible_on_screen_notifier_2d_screen_exited() -> void: - disappear() +func _on_top_visible_on_screen_notifier_screen_exited() -> void: + if top_to_bottom: + disappear() + + +func _on_bottom_visible_on_screen_notifier_screen_exited() -> void: + if not top_to_bottom: + disappear() diff --git a/sources/minigames/frog/lilypad.tscn b/sources/minigames/frog/lilypad.tscn index 1afd70c0..999a6e2c 100644 --- a/sources/minigames/frog/lilypad.tscn +++ b/sources/minigames/frog/lilypad.tscn @@ -133,6 +133,14 @@ anchor_bottom = 0.5 grow_horizontal = 2 grow_vertical = 2 +[node name="TopVisibleOnScreenNotifier" type="VisibleOnScreenNotifier2D" parent="TextureButton"] +unique_name_in_owner = true +position = Vector2(150, -42) + +[node name="BottomVisibleOnScreenNotifier" type="VisibleOnScreenNotifier2D" parent="TextureButton"] +unique_name_in_owner = true +position = Vector2(150, 342) + [node name="Label" type="Label" parent="."] unique_name_in_owner = true layout_mode = 1 @@ -150,8 +158,7 @@ label_settings = ExtResource("8_4pqhl") horizontal_alignment = 1 vertical_alignment = 1 -[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."] - [connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"] [connection signal="pressed" from="TextureButton" to="." method="_on_texture_button_pressed"] -[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"] +[connection signal="screen_exited" from="TextureButton/TopVisibleOnScreenNotifier" to="." method="_on_top_visible_on_screen_notifier_screen_exited"] +[connection signal="screen_exited" from="TextureButton/BottomVisibleOnScreenNotifier" to="." method="_on_bottom_visible_on_screen_notifier_screen_exited"] diff --git a/sources/minigames/frog/lilypad_track.gd b/sources/minigames/frog/lilypad_track.gd index 912a2ee7..8f79c47d 100644 --- a/sources/minigames/frog/lilypad_track.gd +++ b/sources/minigames/frog/lilypad_track.gd @@ -119,6 +119,8 @@ func _spawn_lilypad() -> void: else: lilypad.stop_highlight() + lilypad.top_to_bottom = top_to_bottom + lilypad.pressed.connect(_on_lilypad_pressed.bind(lilypad)) lilypad.disappeared.connect(_on_lilypad_disappeared.bind(lilypad))