fish minigame tutorial
This commit is contained in:
@@ -54,6 +54,16 @@ func _ready() -> void:
|
||||
"help": "",
|
||||
"end": "",
|
||||
},
|
||||
"fish": {
|
||||
"intro": "",
|
||||
"intro_test_game_first_word": "",
|
||||
"lose_test_game_first_word": "",
|
||||
"win_test_game_first_word": "",
|
||||
"lose_test_game_second_word": "",
|
||||
"win_test_game_second_word": "",
|
||||
"end": "",
|
||||
"lose": "",
|
||||
}
|
||||
}
|
||||
|
||||
for speech_title in speeches.keys():
|
||||
|
||||
@@ -28,6 +28,7 @@ var words_to_present: Array[String] = []
|
||||
var words_to_present_next: Array[String] = []
|
||||
var progress_gauge_max_margin: = 0.95
|
||||
var total_number_of_words: = 30
|
||||
var tutorial_count: = 0
|
||||
|
||||
|
||||
func _fish_get_drag_data(_at_position: Vector2) -> Variant:
|
||||
@@ -61,6 +62,11 @@ func _find_stimuli_and_distractions() -> void:
|
||||
for word: String in distractions:
|
||||
words_to_present.append(word)
|
||||
words_to_present.shuffle()
|
||||
if tutorial_count == 0:
|
||||
words_to_present.erase(stimuli[0])
|
||||
words_to_present.erase(distractions[0])
|
||||
words_to_present.insert(0, distractions[0])
|
||||
words_to_present.insert(0, stimuli[0])
|
||||
total_number_of_words = words_to_present.size()
|
||||
progress_gauge_goal.margin_top_ratio = (1. - minimum_correct_ratio) * progress_gauge_max_margin
|
||||
|
||||
@@ -83,6 +89,10 @@ func _present_next_word() -> void:
|
||||
words_to_present_next = []
|
||||
label.show()
|
||||
label.text = words_to_present[0]
|
||||
if tutorial_count == 0:
|
||||
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(minigame_name, "intro_test_game_first_word"))
|
||||
minigame_ui.play_kalulu_speech(speech)
|
||||
await minigame_ui.kalulu_speech_ended
|
||||
|
||||
|
||||
func _on_time_out() -> void:
|
||||
@@ -117,12 +127,32 @@ func _on_beacon_fish_dropped(is_answered_real: bool) -> void:
|
||||
else:
|
||||
false_right_fx.play()
|
||||
words_to_present.pop_front()
|
||||
if tutorial_count == 0:
|
||||
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(minigame_name, "win_test_game_first_word"))
|
||||
minigame_ui.play_kalulu_speech(speech)
|
||||
await minigame_ui.kalulu_speech_ended
|
||||
tutorial_count += 1
|
||||
elif tutorial_count == 1:
|
||||
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(minigame_name, "win_test_game_second_word"))
|
||||
minigame_ui.play_kalulu_speech(speech)
|
||||
await minigame_ui.kalulu_speech_ended
|
||||
tutorial_count += 1
|
||||
else:
|
||||
if is_answered_real:
|
||||
real_wrong_fx.play()
|
||||
else:
|
||||
false_wrong_fx.play()
|
||||
words_to_present_next.append(words_to_present.pop_front())
|
||||
if tutorial_count == 0:
|
||||
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(minigame_name, "lose_test_game_first_word"))
|
||||
minigame_ui.play_kalulu_speech(speech)
|
||||
await minigame_ui.kalulu_speech_ended
|
||||
tutorial_count += 1
|
||||
elif tutorial_count == 1:
|
||||
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(minigame_name, "lose_test_game_second_word"))
|
||||
minigame_ui.play_kalulu_speech(speech)
|
||||
await minigame_ui.kalulu_speech_ended
|
||||
tutorial_count += 1
|
||||
_update_progression_gauge()
|
||||
_present_next_word()
|
||||
|
||||
|
||||
@@ -484,6 +484,7 @@ script = ExtResource("2_68jip")
|
||||
game_duration = 240
|
||||
minimum_correct_ratio = 0.8
|
||||
winning_color = Color(2.988, 2.328, 0.6, 1)
|
||||
minigame_name = "fish"
|
||||
lesson_nb = 50
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="." index="0"]
|
||||
|
||||
@@ -154,7 +154,7 @@ func get_words_for_lesson(lesson_nb: int, only_new: = false) -> Array:
|
||||
|
||||
|
||||
func get_syllables_for_lesson(lesson_nb: int, only_new: = false) -> Array:
|
||||
var query: = "SELECT * FROM Syllables
|
||||
var query: = "SELECT *, LessonNb FROM Syllables
|
||||
INNER JOIN
|
||||
(SELECT SyllableID, count() as Count FROM GPsInSyllables
|
||||
INNER JOIN GPsInLessons ON GPsInLessons.GPID = GPsInSyllables.GPID
|
||||
|
||||
@@ -4,10 +4,12 @@ class_name RightFX
|
||||
signal finished()
|
||||
|
||||
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
||||
@onready var audio_player: AudioStreamPlayer2D = $AudioStreamPlayer2D
|
||||
|
||||
|
||||
func play() -> void:
|
||||
animation_player.play("right")
|
||||
audio_player.play()
|
||||
|
||||
|
||||
func _on_animation_player_animation_finished(animation_name: StringName) -> void:
|
||||
|
||||
@@ -4,10 +4,12 @@ class_name WrongFX
|
||||
signal finished()
|
||||
|
||||
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
||||
@onready var audio_player: AudioStreamPlayer2D = $AudioStreamPlayer2D
|
||||
|
||||
|
||||
func play() -> void:
|
||||
animation_player.play("wrong")
|
||||
audio_player.play()
|
||||
|
||||
|
||||
func _on_animation_player_animation_finished(animation_name: StringName) -> void:
|
||||
|
||||
Reference in New Issue
Block a user