Remove all 160 warnings
This commit is contained in:
+10
-10
@@ -11,7 +11,7 @@ const garden_scene: = preload("res://resources/gardens/garden.tscn")
|
|||||||
const look_and_learn_scene: = preload("res://sources/look_and_learn/look_and_learn.tscn")
|
const look_and_learn_scene: = preload("res://sources/look_and_learn/look_and_learn.tscn")
|
||||||
const flower_fvx: = preload("res://sources/gardens/flower_particle.tscn")
|
const flower_fvx: = preload("res://sources/gardens/flower_particle.tscn")
|
||||||
|
|
||||||
const garden_size: = 2400
|
const garden_size: int = 2400
|
||||||
|
|
||||||
@export_category("Layout")
|
@export_category("Layout")
|
||||||
@export var gardens_layout: GardensLayout:
|
@export var gardens_layout: GardensLayout:
|
||||||
@@ -48,7 +48,7 @@ const garden_size: = 2400
|
|||||||
@onready var minigame_background_center: TextureRect = %MinigameBackgroundCenter
|
@onready var minigame_background_center: TextureRect = %MinigameBackgroundCenter
|
||||||
@onready var lock: Control = %Lock
|
@onready var lock: Control = %Lock
|
||||||
@onready var kalulu: Kalulu = %Kalulu
|
@onready var kalulu: Kalulu = %Kalulu
|
||||||
@onready var kalulu_button: = %KaluluButton
|
@onready var kalulu_button: CanvasItem = %KaluluButton
|
||||||
|
|
||||||
@onready var intro_speech: = Database.load_external_sound(Database.get_kalulu_speech_path("gardens_screen", "intro"))
|
@onready var intro_speech: = Database.load_external_sound(Database.get_kalulu_speech_path("gardens_screen", "intro"))
|
||||||
@onready var help_few_plants_speech: = Database.load_external_sound(Database.get_kalulu_speech_path("gardens_screen", "help_few_plants"))
|
@onready var help_few_plants_speech: = Database.load_external_sound(Database.get_kalulu_speech_path("gardens_screen", "help_few_plants"))
|
||||||
@@ -58,7 +58,7 @@ var curve: Curve2D
|
|||||||
var lessons: = {}
|
var lessons: = {}
|
||||||
var points: Array[Array]= []
|
var points: Array[Array]= []
|
||||||
var is_scrolling: = false
|
var is_scrolling: = false
|
||||||
var scroll_beginning_garden: = 0
|
var scroll_beginning_garden: int = 0
|
||||||
var scroll_tween: Tween
|
var scroll_tween: Tween
|
||||||
var is_locked: = false
|
var is_locked: = false
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ func _ready() -> void:
|
|||||||
play_animation = true
|
play_animation = true
|
||||||
|
|
||||||
if play_animation:
|
if play_animation:
|
||||||
var fvfx: = flower_fvx.instantiate()
|
var fvfx: FlowerVFX = flower_fvx.instantiate()
|
||||||
current_garden.flower_controls[flower_ind].add_child(fvfx)
|
current_garden.flower_controls[flower_ind].add_child(fvfx)
|
||||||
fvfx.anchor_bottom = 0.5
|
fvfx.anchor_bottom = 0.5
|
||||||
fvfx.anchor_top = 0.5
|
fvfx.anchor_top = 0.5
|
||||||
@@ -302,7 +302,7 @@ func _ready() -> void:
|
|||||||
await get_tree().create_timer(1).timeout
|
await get_tree().create_timer(1).timeout
|
||||||
|
|
||||||
# Re-open the minigames layout
|
# Re-open the minigames layout
|
||||||
await _open_minigames_layout(_get_current_lesson_button(transition_data.current_lesson_number), transition_data.current_lesson_number as int, transition_data.current_garden as int)
|
await _open_minigames_layout(_get_current_lesson_button(transition_data.current_lesson_number as int), transition_data.current_lesson_number as int)
|
||||||
|
|
||||||
#region New lesson unlocked
|
#region New lesson unlocked
|
||||||
|
|
||||||
@@ -350,9 +350,9 @@ func _ready() -> void:
|
|||||||
tween.set_ease(Tween.EASE_IN_OUT)
|
tween.set_ease(Tween.EASE_IN_OUT)
|
||||||
tween.tween_property(scroll_container, "scroll_horizontal", target_scroll, 4)
|
tween.tween_property(scroll_container, "scroll_horizontal", target_scroll, 4)
|
||||||
|
|
||||||
|
@warning_ignore("integer_division")
|
||||||
scroll_beginning_garden = target_scroll / garden_size
|
scroll_beginning_garden = target_scroll / garden_size
|
||||||
|
|
||||||
@warning_ignore("integer_division")
|
|
||||||
current_garden = garden_parent.get_child(scroll_beginning_garden)
|
current_garden = garden_parent.get_child(scroll_beginning_garden)
|
||||||
|
|
||||||
line_audio_stream_player.pitch_scale = 0.95
|
line_audio_stream_player.pitch_scale = 0.95
|
||||||
@@ -392,7 +392,7 @@ func _process(_delta: float) -> void:
|
|||||||
parallax_background.scroll_offset.x = - scroll_container.scroll_horizontal
|
parallax_background.scroll_offset.x = - scroll_container.scroll_horizontal
|
||||||
|
|
||||||
|
|
||||||
func _open_minigames_layout(button: LessonButton, lesson_ind: int, garden_ind: int) -> void:
|
func _open_minigames_layout(button: LessonButton, lesson_ind: int) -> void:
|
||||||
if in_minigame_selection or not UserDataManager.student_progression:
|
if in_minigame_selection or not UserDataManager.student_progression:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -545,7 +545,7 @@ func _set_up_lessons() -> void:
|
|||||||
if not lesson_ind in lessons:
|
if not lesson_ind in lessons:
|
||||||
break
|
break
|
||||||
garden_control.set_lesson_label(i, lessons[lesson_ind][0].grapheme as String)
|
garden_control.set_lesson_label(i, lessons[lesson_ind][0].grapheme as String)
|
||||||
garden_control.lesson_button_controls[i].pressed.connect(_on_garden_lesson_button_pressed.bind(garden_control.lesson_button_controls[i], lesson_ind, garden_ind))
|
garden_control.lesson_button_controls[i].pressed.connect(_on_garden_lesson_button_pressed.bind(garden_control.lesson_button_controls[i], lesson_ind))
|
||||||
lesson_ind += 1
|
lesson_ind += 1
|
||||||
|
|
||||||
|
|
||||||
@@ -627,8 +627,8 @@ func _get_current_lesson_button(lesson: int) -> LessonButton:
|
|||||||
return null
|
return null
|
||||||
|
|
||||||
|
|
||||||
func _on_garden_lesson_button_pressed(button: LessonButton, lesson_ind: int, garden_ind: int, button_global_position: = Vector2.ZERO) -> void:
|
func _on_garden_lesson_button_pressed(button: LessonButton, lesson_ind: int) -> void:
|
||||||
_open_minigames_layout(button, lesson_ind, garden_ind)
|
_open_minigames_layout(button, lesson_ind)
|
||||||
|
|
||||||
|
|
||||||
func _on_lesson_button_pressed() -> void:
|
func _on_lesson_button_pressed() -> void:
|
||||||
|
|||||||
@@ -57,22 +57,18 @@ func setup() -> void:
|
|||||||
var gp_sound: = Database.get_gp_look_and_learn_sound(gp)
|
var gp_sound: = Database.get_gp_look_and_learn_sound(gp)
|
||||||
var gp_video: = Database.get_gp_look_and_learn_video(gp)
|
var gp_video: = Database.get_gp_look_and_learn_video(gp)
|
||||||
|
|
||||||
var used: = false
|
|
||||||
|
|
||||||
if gp_video:
|
if gp_video:
|
||||||
videos.append(gp_video)
|
videos.append(gp_video)
|
||||||
used = true
|
|
||||||
|
|
||||||
if gp_image and gp_sound:
|
if gp_image and gp_sound:
|
||||||
images.append(gp_image)
|
images.append(gp_image)
|
||||||
sounds.append(gp_sound)
|
sounds.append(gp_sound)
|
||||||
used = true
|
|
||||||
|
|
||||||
var tracing_data: = tracing_manager._get_letter_tracings(gp.Grapheme)
|
var tracing_data: = tracing_manager._get_letter_tracings(gp.Grapheme as String)
|
||||||
if tracing_data.upper:
|
if tracing_data.upper:
|
||||||
gp_display.append(gp.Grapheme.to_upper())
|
gp_display.append((gp.Grapheme as String).to_upper())
|
||||||
if tracing_data.lower:
|
if tracing_data.lower:
|
||||||
gp_display.append(gp.Grapheme.to_lower())
|
gp_display.append((gp.Grapheme as String).to_lower())
|
||||||
|
|
||||||
if gp_display.is_empty():
|
if gp_display.is_empty():
|
||||||
gp_display.append(gp_list[0].Grapheme)
|
gp_display.append(gp_list[0].Grapheme)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const Kalulu: = preload("res://sources/minigames/base/kalulu.gd")
|
|||||||
@export var gardens_layout: GardensLayout
|
@export var gardens_layout: GardensLayout
|
||||||
|
|
||||||
@onready var kalulu: Kalulu = $Kalulu
|
@onready var kalulu: Kalulu = $Kalulu
|
||||||
@onready var kalulu_button: = %KaluluButton
|
@onready var kalulu_button: TextureButton = %KaluluButton
|
||||||
@onready var audio_stream_player: AudioStreamPlayer = $AudioStreamPlayer
|
@onready var audio_stream_player: AudioStreamPlayer = $AudioStreamPlayer
|
||||||
|
|
||||||
@onready var garden_buttons: Array[TextureButton] = [
|
@onready var garden_buttons: Array[TextureButton] = [
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const Kalulu: = preload("res://sources/minigames/base/kalulu.gd")
|
|||||||
@onready var keyboard : CodeKeyboard = $CodeKeyboard
|
@onready var keyboard : CodeKeyboard = $CodeKeyboard
|
||||||
@onready var teacher_timer : Timer = %TeacherTimer
|
@onready var teacher_timer : Timer = %TeacherTimer
|
||||||
@onready var teacher_help_label: Label = %TeacherHelpLabel
|
@onready var teacher_help_label: Label = %TeacherHelpLabel
|
||||||
@onready var kalulu_button: = %KaluluButton
|
@onready var kalulu_button: CanvasItem = %KaluluButton
|
||||||
|
|
||||||
var help_speech: AudioStream
|
var help_speech: AudioStream
|
||||||
var wrong_password_speech: AudioStream
|
var wrong_password_speech: AudioStream
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
extends Area2D
|
extends Area2D
|
||||||
|
|
||||||
@onready var animation_player: = $AnimationPlayer
|
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
||||||
@onready var anchor: = $Anchor
|
@onready var anchor: = $Anchor
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const word_class: = preload("res://sources/minigames/ants/word.tscn")
|
|||||||
|
|
||||||
const label_settings: = preload("res://resources/themes/minigames_label_settings.tres")
|
const label_settings: = preload("res://resources/themes/minigames_label_settings.tres")
|
||||||
|
|
||||||
@onready var sentence: HFlowContainer = %Sentence
|
@onready var sentence_container: HFlowContainer = %Sentence
|
||||||
@onready var ants_spawn: Node2D = %AntsSpawn
|
@onready var ants_spawn: Node2D = %AntsSpawn
|
||||||
@onready var ants_start: Node2D = %AntsStart
|
@onready var ants_start: Node2D = %AntsStart
|
||||||
@onready var ants_end: Node2D = %AntsEnd
|
@onready var ants_end: Node2D = %AntsEnd
|
||||||
@@ -31,11 +31,11 @@ func _find_stimuli_and_distractions() -> void:
|
|||||||
var current_lesson_sentences: = []
|
var current_lesson_sentences: = []
|
||||||
var previous_lesson_sentences: = []
|
var previous_lesson_sentences: = []
|
||||||
|
|
||||||
for sentence: Dictionary in sentences_list:
|
for sentence_in_list: Dictionary in sentences_list:
|
||||||
if sentence.LessonNb == lesson_nb:
|
if sentence_in_list.LessonNb == lesson_nb:
|
||||||
current_lesson_sentences.append(sentence)
|
current_lesson_sentences.append(sentence_in_list)
|
||||||
else:
|
else:
|
||||||
previous_lesson_sentences.append(sentence)
|
previous_lesson_sentences.append(sentence_in_list)
|
||||||
|
|
||||||
# Shuffle everything
|
# Shuffle everything
|
||||||
current_lesson_sentences.shuffle()
|
current_lesson_sentences.shuffle()
|
||||||
@@ -98,9 +98,9 @@ func _get_new_sentence() -> void:
|
|||||||
|
|
||||||
func _next_sentence() -> void:
|
func _next_sentence() -> void:
|
||||||
var nodes: = []
|
var nodes: = []
|
||||||
nodes.append_array(sentence.get_children())
|
nodes.append_array(sentence_container.get_children())
|
||||||
nodes.append_array(words.get_children())
|
nodes.append_array(words.get_children())
|
||||||
for node in nodes:
|
for node: Node in nodes:
|
||||||
node.queue_free()
|
node.queue_free()
|
||||||
|
|
||||||
for ant: Ant in ants.get_children():
|
for ant: Ant in ants.get_children():
|
||||||
@@ -115,7 +115,7 @@ func _next_sentence() -> void:
|
|||||||
|
|
||||||
current_sentence = stimuli.pop_front()
|
current_sentence = stimuli.pop_front()
|
||||||
|
|
||||||
var current_words: PackedStringArray = current_sentence.Sentence.replace("'", " ' ").replace("-", " - ").split(" ")
|
var current_words: PackedStringArray = (current_sentence.Sentence as String).replace("'", " ' ").replace("-", " - ").split(" ")
|
||||||
|
|
||||||
var inds_to_remove: = []
|
var inds_to_remove: = []
|
||||||
for i in range(1, current_words.size()):
|
for i in range(1, current_words.size()):
|
||||||
@@ -129,7 +129,7 @@ func _next_sentence() -> void:
|
|||||||
inds_to_remove.append(i)
|
inds_to_remove.append(i)
|
||||||
|
|
||||||
inds_to_remove.reverse()
|
inds_to_remove.reverse()
|
||||||
for ind in inds_to_remove:
|
for ind: int in inds_to_remove:
|
||||||
current_words.remove_at(ind)
|
current_words.remove_at(ind)
|
||||||
|
|
||||||
var number_of_blanks: int = maxi(2, mini(difficulty, current_words.size()))
|
var number_of_blanks: int = maxi(2, mini(difficulty, current_words.size()))
|
||||||
@@ -143,19 +143,20 @@ func _next_sentence() -> void:
|
|||||||
for i in range(current_words.size()):
|
for i in range(current_words.size()):
|
||||||
var current_word: = current_words[i]
|
var current_word: = current_words[i]
|
||||||
if i in blanks:
|
if i in blanks:
|
||||||
var blank: = blank_class.instantiate()
|
var blank: Blank = blank_class.instantiate()
|
||||||
blank.stimulus = current_word
|
blank.stimulus = current_word
|
||||||
sentence.add_child(blank)
|
sentence_container.add_child(blank)
|
||||||
|
|
||||||
var ant: = ant_class.instantiate()
|
var ant: Node2D = ant_class.instantiate()
|
||||||
ants.add_child(ant)
|
ants.add_child(ant)
|
||||||
ant.global_position = ants_spawn.global_position
|
ant.global_position = ants_spawn.global_position
|
||||||
|
|
||||||
var word: = word_class.instantiate()
|
var word: Word = word_class.instantiate()
|
||||||
words.add_child(word)
|
words.add_child(word)
|
||||||
|
|
||||||
word.stimulus = current_word
|
word.stimulus = current_word
|
||||||
word.current_anchor = ant
|
word.current_anchor = ant
|
||||||
|
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||||
word.current_anchor.set_monitorable(false)
|
word.current_anchor.set_monitorable(false)
|
||||||
|
|
||||||
answered.append(false)
|
answered.append(false)
|
||||||
@@ -165,7 +166,7 @@ func _next_sentence() -> void:
|
|||||||
word.no_answer.connect(_on_word_no_answer.bind(word))
|
word.no_answer.connect(_on_word_no_answer.bind(word))
|
||||||
else:
|
else:
|
||||||
var label: = Label.new()
|
var label: = Label.new()
|
||||||
sentence.add_child(label)
|
sentence_container.add_child(label)
|
||||||
|
|
||||||
label.text = current_word + " "
|
label.text = current_word + " "
|
||||||
label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||||
@@ -188,7 +189,11 @@ func _start_ants() -> void:
|
|||||||
ant.idle()
|
ant.idle()
|
||||||
|
|
||||||
for word in words.get_children():
|
for word in words.get_children():
|
||||||
word.disabled = false
|
if word is Control:
|
||||||
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
|
(word as Control).disabled = false
|
||||||
|
else:
|
||||||
|
push_error("Ants_Minigame: variable \"word\" is not of type Control")
|
||||||
|
|
||||||
|
|
||||||
func _on_current_progression_changed() -> void:
|
func _on_current_progression_changed() -> void:
|
||||||
@@ -205,41 +210,51 @@ func _on_word_answer(stimulus: String, expected_stimulus: String, word: TextureB
|
|||||||
answered[word.get_index()] = true
|
answered[word.get_index()] = true
|
||||||
|
|
||||||
var all_answered: = true
|
var all_answered: = true
|
||||||
for a in answered:
|
for a: bool in answered:
|
||||||
if not a:
|
if not a:
|
||||||
all_answered = false
|
all_answered = false
|
||||||
break
|
break
|
||||||
|
|
||||||
if all_answered:
|
if all_answered:
|
||||||
var is_right: = true
|
var is_right: = true
|
||||||
for a in answers:
|
for a: bool in answers:
|
||||||
if not a:
|
if not a:
|
||||||
is_right = false
|
is_right = false
|
||||||
break
|
break
|
||||||
|
|
||||||
for word_i in words.get_children():
|
for word_i in words.get_children():
|
||||||
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
|
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||||
word_i.current_anchor.set_monitorable(true)
|
word_i.current_anchor.set_monitorable(true)
|
||||||
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
word_i.disabled = true
|
word_i.disabled = true
|
||||||
|
|
||||||
if is_right:
|
if is_right:
|
||||||
for i in range(words.get_child_count() - 1):
|
for i in range(words.get_child_count() - 1):
|
||||||
|
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||||
words.get_child(i).right()
|
words.get_child(i).right()
|
||||||
|
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||||
await words.get_child(words.get_child_count() - 1).right()
|
await words.get_child(words.get_child_count() - 1).right()
|
||||||
|
|
||||||
current_progression += 1
|
current_progression += 1
|
||||||
else:
|
else:
|
||||||
for i in range(words.get_child_count() - 1):
|
for i in range(words.get_child_count() - 1):
|
||||||
|
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||||
words.get_child(i).wrong()
|
words.get_child(i).wrong()
|
||||||
|
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||||
await words.get_child(words.get_child_count() - 1).wrong()
|
await words.get_child(words.get_child_count() - 1).wrong()
|
||||||
|
|
||||||
current_lives -= 1
|
current_lives -= 1
|
||||||
|
|
||||||
for i in range(ants.get_child_count()):
|
for i in range(ants.get_child_count()):
|
||||||
answered[i] = false
|
answered[i] = false
|
||||||
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
words.get_child(i).current_anchor = ants.get_child(i)
|
words.get_child(i).current_anchor = ants.get_child(i)
|
||||||
|
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||||
ants.get_child(i).set_monitorable(false)
|
ants.get_child(i).set_monitorable(false)
|
||||||
|
|
||||||
for word_i in words.get_children():
|
for word_i in words.get_children():
|
||||||
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
word_i.disabled = false
|
word_i.disabled = false
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
extends TextureRect
|
extends TextureRect
|
||||||
|
|
||||||
|
class_name Blank
|
||||||
|
|
||||||
const images: = [
|
const images: = [
|
||||||
"res://assets/minigames/ants/graphics/hole_02.png",
|
"res://assets/minigames/ants/graphics/hole_02.png",
|
||||||
"res://assets/minigames/ants/graphics/hole_03.png",
|
"res://assets/minigames/ants/graphics/hole_03.png",
|
||||||
@@ -8,11 +10,11 @@ const images: = [
|
|||||||
|
|
||||||
var stimulus: String
|
var stimulus: String
|
||||||
|
|
||||||
@onready var area: = $Area2D
|
@onready var area: Area2D = $Area2D
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
texture = load(images[randi() % images.size()])
|
texture = load(images[randi() % images.size()] as String)
|
||||||
|
|
||||||
|
|
||||||
func set_monitorable(p_monitorable: bool) -> void:
|
func set_monitorable(p_monitorable: bool) -> void:
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
|
# TODO: Clean the reason why there is so much UNSAFE_PROPERTY_ACCESS in this script.
|
||||||
extends TextureButton
|
extends TextureButton
|
||||||
|
|
||||||
|
class_name Word
|
||||||
|
|
||||||
const Ant: = preload("res://sources/minigames/ants/ant.gd")
|
const Ant: = preload("res://sources/minigames/ants/ant.gd")
|
||||||
|
|
||||||
signal answer(good: bool)
|
signal answer(good: bool)
|
||||||
signal no_answer()
|
signal no_answer()
|
||||||
|
|
||||||
@onready var area: = $Area2D
|
@onready var area: Area2D = $Area2D
|
||||||
@onready var label: = %Label
|
@onready var label: Label = %Label
|
||||||
@onready var right_fx: = $RightFX
|
@onready var right_fx: RightFX = $RightFX
|
||||||
@onready var wrong_fx: = $WrongFX
|
@onready var wrong_fx: WrongFX = $WrongFX
|
||||||
|
|
||||||
var stimulus: String:
|
var stimulus: String:
|
||||||
set = _set_stimulus
|
set = _set_stimulus
|
||||||
@@ -31,14 +34,15 @@ func _process(_delta: float) -> void:
|
|||||||
global_position = get_global_mouse_position() - size / 2.0
|
global_position = get_global_mouse_position() - size / 2.0
|
||||||
else:
|
else:
|
||||||
if current_anchor is Area2D:
|
if current_anchor is Area2D:
|
||||||
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
global_position = current_anchor.anchor.global_position
|
global_position = current_anchor.anchor.global_position
|
||||||
else:
|
else:
|
||||||
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
global_position = current_anchor.global_position
|
global_position = current_anchor.global_position
|
||||||
|
|
||||||
|
|
||||||
func _set_stimulus(value: String) -> void:
|
func _set_stimulus(value: String) -> void:
|
||||||
stimulus = value
|
stimulus = value
|
||||||
|
|
||||||
label.text = stimulus
|
label.text = stimulus
|
||||||
|
|
||||||
|
|
||||||
@@ -50,21 +54,27 @@ func _on_button_up() -> void:
|
|||||||
follow_mouse = false
|
follow_mouse = false
|
||||||
|
|
||||||
var destination: = current_anchor
|
var destination: = current_anchor
|
||||||
var min_distance: float = (current_anchor.global_position - global_position).length()
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
|
var min_distance: float = ((current_anchor.global_position - global_position) as Vector2).length()
|
||||||
for other_area in area.get_overlapping_areas():
|
for other_area in area.get_overlapping_areas():
|
||||||
var other: CanvasItem = other_area
|
var other: CanvasItem = other_area
|
||||||
if not other_area is Ant:
|
if not other_area is Ant:
|
||||||
other = other_area.owner
|
other = other_area.owner
|
||||||
var dist: float = (other.global_position - global_position).length()
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
|
var dist: float = ((other.global_position - global_position ) as Vector2).length()
|
||||||
if dist < min_distance:
|
if dist < min_distance:
|
||||||
destination = other
|
destination = other
|
||||||
min_distance = dist
|
min_distance = dist
|
||||||
|
|
||||||
|
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||||
current_anchor.set_monitorable(true)
|
current_anchor.set_monitorable(true)
|
||||||
current_anchor = destination
|
current_anchor = destination
|
||||||
if destination is Ant:
|
if destination is Ant:
|
||||||
|
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||||
destination.set_monitorable(false)
|
destination.set_monitorable(false)
|
||||||
no_answer.emit()
|
no_answer.emit()
|
||||||
else:
|
else:
|
||||||
|
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||||
destination.set_monitorable(false)
|
destination.set_monitorable(false)
|
||||||
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
answer.emit(stimulus, destination.stimulus)
|
answer.emit(stimulus, destination.stimulus)
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ func _curtains_and_kalulu() -> void:
|
|||||||
if not UserDataManager.is_speech_played(Type.keys()[minigame_name] as String):
|
if not UserDataManager.is_speech_played(Type.keys()[minigame_name] as String):
|
||||||
minigame_ui.play_kalulu_speech(intro_kalulu_speech)
|
minigame_ui.play_kalulu_speech(intro_kalulu_speech)
|
||||||
await minigame_ui.kalulu_speech_ended
|
await minigame_ui.kalulu_speech_ended
|
||||||
UserDataManager.mark_speech_as_played(Type.keys()[minigame_name])
|
UserDataManager.mark_speech_as_played(Type.keys()[minigame_name] as String)
|
||||||
|
|
||||||
|
|
||||||
# Launch the minigame
|
# Launch the minigame
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ func _get_current_distractors() -> Array:
|
|||||||
# Get the current GP to find
|
# Get the current GP to find
|
||||||
func _get_GP() -> Dictionary:
|
func _get_GP() -> Dictionary:
|
||||||
var stimulus: = _get_current_stimulus()
|
var stimulus: = _get_current_stimulus()
|
||||||
if not stimulus or not stimulus.has("GPs") or current_word_progression >= stimulus.GPs.size():
|
if not stimulus or not stimulus.has("GPs") or current_word_progression >= (stimulus.GPs as Array).size():
|
||||||
return {}
|
return {}
|
||||||
return stimulus.GPs[current_word_progression]
|
return stimulus.GPs[current_word_progression]
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ func _on_current_progression_changed() -> void:
|
|||||||
|
|
||||||
# Show the word for some time and play the stimulus again
|
# Show the word for some time and play the stimulus again
|
||||||
await get_tree().create_timer(time_between_words/2).timeout
|
await get_tree().create_timer(time_between_words/2).timeout
|
||||||
await audio_player.play_word(_get_previous_stimulus().Word)
|
await audio_player.play_word(_get_previous_stimulus().Word as String)
|
||||||
await get_tree().create_timer(time_between_words/2).timeout
|
await get_tree().create_timer(time_between_words/2).timeout
|
||||||
|
|
||||||
# Reset the caterpillar
|
# Reset the caterpillar
|
||||||
|
|||||||
@@ -4,19 +4,19 @@ signal beacon_fish_dropped(is_answered_real: bool)
|
|||||||
|
|
||||||
const fish_texture_rect_scene: = preload("res://sources/minigames/fish/fish_texture_rect.tscn")
|
const fish_texture_rect_scene: = preload("res://sources/minigames/fish/fish_texture_rect.tscn")
|
||||||
|
|
||||||
@onready var fish_start_zone: = %FishStartZone
|
@onready var fish_start_zone: Control = %FishStartZone
|
||||||
@onready var beacon1: = %Beacon1
|
@onready var beacon1: SpriteControl = %Beacon1
|
||||||
@onready var beacon2: = %Beacon2
|
@onready var beacon2: SpriteControl = %Beacon2
|
||||||
@onready var path_follow: = %PathFollow2D
|
@onready var path_follow: PathFollow2D = %PathFollow2D
|
||||||
@onready var label: = %Label
|
@onready var label: Label = %Label
|
||||||
@onready var false_wrong_fx: = %FalseWrongFX
|
@onready var false_wrong_fx: WrongFX = %FalseWrongFX
|
||||||
@onready var false_right_fx: = %FalseRightFX
|
@onready var false_right_fx: RightFX = %FalseRightFX
|
||||||
@onready var real_wrong_fx: = %RealWrongFX
|
@onready var real_wrong_fx: WrongFX = %RealWrongFX
|
||||||
@onready var real_right_fx: = %RealRightFX
|
@onready var real_right_fx: RightFX = %RealRightFX
|
||||||
@onready var fish_animated_sprite: = %FishAnimatedSprite
|
@onready var fish_animated_sprite: AnimatedSprite2D = %FishAnimatedSprite
|
||||||
@onready var progress_gauge: = %ProgressionGaugePercentMarginContainer
|
@onready var progress_gauge: PercentMarginContainer = %ProgressionGaugePercentMarginContainer
|
||||||
@onready var progress_gauge_goal: = %ProgressionGaugeGoalPercentMarginContainer2
|
@onready var progress_gauge_goal: PercentMarginContainer = %ProgressionGaugeGoalPercentMarginContainer2
|
||||||
@onready var progress_gauge_internal: = %ProgressionGaugeInternal
|
@onready var progress_gauge_internal: NinePatchRect = %ProgressionGaugeInternal
|
||||||
|
|
||||||
|
|
||||||
@export var game_duration: = 4 * 60
|
@export var game_duration: = 4 * 60
|
||||||
@@ -42,12 +42,13 @@ func _fish_get_drag_data(_at_position: Vector2) -> Variant:
|
|||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
super()
|
super()
|
||||||
fish_start_zone.set_drag_forwarding(_fish_get_drag_data, Callable(), Callable())
|
fish_start_zone.set_drag_forwarding(_fish_get_drag_data, Callable(), Callable())
|
||||||
beacon1.set_drag_forwarding(Callable(), _beacon_can_drop_data, _beacon1_drop_data)
|
(beacon1 as Control).set_drag_forwarding(Callable(), _beacon_can_drop_data, _beacon1_drop_data)
|
||||||
beacon2.set_drag_forwarding(Callable(), _beacon_can_drop_data, _beacon2_drop_data)
|
(beacon2 as Control).set_drag_forwarding(Callable(), _beacon_can_drop_data, _beacon2_drop_data)
|
||||||
minigame_ui.lives_container.hide()
|
minigame_ui.lives_container.hide()
|
||||||
minigame_ui.progression_container.hide()
|
minigame_ui.progression_container.hide()
|
||||||
minigame_ui.progression_gauge.hide()
|
minigame_ui.progression_gauge.hide()
|
||||||
label.hide()
|
label.hide()
|
||||||
|
@warning_ignore("UNSAFE_PROPERTY_ACCESS")
|
||||||
progress_gauge_max_margin = progress_gauge.margin_top_ratio
|
progress_gauge_max_margin = progress_gauge.margin_top_ratio
|
||||||
|
|
||||||
# Skips the whole tutorial
|
# Skips the whole tutorial
|
||||||
@@ -98,7 +99,7 @@ func _present_next_word() -> void:
|
|||||||
label.show()
|
label.show()
|
||||||
label.text = words_to_present[0]
|
label.text = words_to_present[0]
|
||||||
if tutorial_count == 0:
|
if tutorial_count == 0:
|
||||||
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(Type.keys()[minigame_name], "intro_test_game_first_word"))
|
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(Type.keys()[minigame_name] as String, "intro_test_game_first_word"))
|
||||||
minigame_ui.play_kalulu_speech(speech)
|
minigame_ui.play_kalulu_speech(speech)
|
||||||
await minigame_ui.kalulu_speech_ended
|
await minigame_ui.kalulu_speech_ended
|
||||||
|
|
||||||
@@ -136,12 +137,12 @@ func _on_beacon_fish_dropped(is_answered_real: bool) -> void:
|
|||||||
false_right_fx.play()
|
false_right_fx.play()
|
||||||
words_to_present.pop_front()
|
words_to_present.pop_front()
|
||||||
if tutorial_count == 0:
|
if tutorial_count == 0:
|
||||||
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(Type.keys()[minigame_name], "win_test_game_first_word"))
|
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(Type.keys()[minigame_name] as String, "win_test_game_first_word"))
|
||||||
minigame_ui.play_kalulu_speech(speech)
|
minigame_ui.play_kalulu_speech(speech)
|
||||||
await minigame_ui.kalulu_speech_ended
|
await minigame_ui.kalulu_speech_ended
|
||||||
tutorial_count += 1
|
tutorial_count += 1
|
||||||
elif tutorial_count == 1:
|
elif tutorial_count == 1:
|
||||||
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(Type.keys()[minigame_name], "win_test_game_second_word"))
|
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(Type.keys()[minigame_name] as String, "win_test_game_second_word"))
|
||||||
minigame_ui.play_kalulu_speech(speech)
|
minigame_ui.play_kalulu_speech(speech)
|
||||||
await minigame_ui.kalulu_speech_ended
|
await minigame_ui.kalulu_speech_ended
|
||||||
tutorial_count += 1
|
tutorial_count += 1
|
||||||
@@ -152,12 +153,12 @@ func _on_beacon_fish_dropped(is_answered_real: bool) -> void:
|
|||||||
false_wrong_fx.play()
|
false_wrong_fx.play()
|
||||||
words_to_present_next.append(words_to_present.pop_front())
|
words_to_present_next.append(words_to_present.pop_front())
|
||||||
if tutorial_count == 0:
|
if tutorial_count == 0:
|
||||||
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(Type.keys()[minigame_name], "lose_test_game_first_word"))
|
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(Type.keys()[minigame_name] as String, "lose_test_game_first_word"))
|
||||||
minigame_ui.play_kalulu_speech(speech)
|
minigame_ui.play_kalulu_speech(speech)
|
||||||
await minigame_ui.kalulu_speech_ended
|
await minigame_ui.kalulu_speech_ended
|
||||||
tutorial_count += 1
|
tutorial_count += 1
|
||||||
elif tutorial_count == 1:
|
elif tutorial_count == 1:
|
||||||
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(Type.keys()[minigame_name], "lose_test_game_second_word"))
|
var speech: = Database.load_external_sound(Database.get_kalulu_speech_path(Type.keys()[minigame_name] as String, "lose_test_game_second_word"))
|
||||||
minigame_ui.play_kalulu_speech(speech)
|
minigame_ui.play_kalulu_speech(speech)
|
||||||
await minigame_ui.kalulu_speech_ended
|
await minigame_ui.kalulu_speech_ended
|
||||||
tutorial_count += 1
|
tutorial_count += 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
@onready var aspect_ratio_container: = $AspectRatioContainer
|
@onready var aspect_ratio_container: AspectRatioContainer = $AspectRatioContainer
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
|
class_name Frog
|
||||||
|
|
||||||
signal drowned()
|
signal drowned()
|
||||||
signal jumped()
|
signal jumped()
|
||||||
|
|
||||||
|
|||||||
@@ -28,15 +28,15 @@ var difficulty_settings: Array[DifficultySettings] = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@onready var start: = %Start
|
@onready var start: Control = %Start
|
||||||
@onready var end: = %End
|
@onready var end: Control = %End
|
||||||
|
|
||||||
@onready var frog_spawn_point: = %FrogSpawnPoint
|
@onready var frog_spawn_point: Control = %FrogSpawnPoint
|
||||||
@onready var frog_despawn_point: = %FrogDespawnPoint
|
@onready var frog_despawn_point: Control = %FrogDespawnPoint
|
||||||
|
|
||||||
@onready var river: TextureRect = $GameRoot/Background/River
|
@onready var river: River = $GameRoot/Background/River
|
||||||
@onready var lilypad_tracks_container: = %LilypadTracksContainer
|
@onready var lilypad_tracks_container: HBoxContainer = %LilypadTracksContainer
|
||||||
@onready var frog: = %Frog
|
@onready var frog: Frog = %Frog
|
||||||
|
|
||||||
|
|
||||||
func _setup_word_progression() -> void:
|
func _setup_word_progression() -> void:
|
||||||
@@ -79,7 +79,7 @@ func _create_tracks() -> void:
|
|||||||
var current_word: = _get_current_stimulus()
|
var current_word: = _get_current_stimulus()
|
||||||
var current_distractors: = _get_current_distractors()
|
var current_distractors: = _get_current_distractors()
|
||||||
|
|
||||||
for i in range(current_word.GPs.size()):
|
for i in range((current_word.GPs as Array).size()):
|
||||||
var track: LilypadTrack = lilypad_track_scene.instantiate()
|
var track: LilypadTrack = lilypad_track_scene.instantiate()
|
||||||
lilypad_tracks_container.add_child(track)
|
lilypad_tracks_container.add_child(track)
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ func _on_current_progression_changed() -> void:
|
|||||||
track.right()
|
track.right()
|
||||||
|
|
||||||
# Replay the stimulus
|
# Replay the stimulus
|
||||||
await audio_player.play_word(_get_previous_stimulus().Word)
|
await audio_player.play_word(_get_previous_stimulus().Word as String)
|
||||||
|
|
||||||
# Makes the frog jumps out of screen
|
# Makes the frog jumps out of screen
|
||||||
frog.jump_to(frog_despawn_point.global_position)
|
frog.jump_to(frog_despawn_point.global_position)
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ const lilypad_scene: = preload("res://sources/minigames/frog/lilypad.tscn")
|
|||||||
const lilypad_crossing_time: = 5.0
|
const lilypad_crossing_time: = 5.0
|
||||||
|
|
||||||
|
|
||||||
@onready var audio_player: = $AudioStreamPlayer2D
|
@onready var audio_player: AudioStreamPlayer2D = $AudioStreamPlayer2D
|
||||||
@onready var spawn_timer: = $SpawnTimer
|
@onready var spawn_timer: Timer = $SpawnTimer
|
||||||
|
|
||||||
var top_to_bottom: bool = false
|
var top_to_bottom: bool = false
|
||||||
var is_stopped: bool = false
|
var is_stopped: bool = false
|
||||||
@@ -35,7 +35,7 @@ var lilypads: Array[Lilypad] = []
|
|||||||
var lilypad_size: Vector2
|
var lilypad_size: Vector2
|
||||||
|
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta: float) -> void:
|
||||||
if is_stopped:
|
if is_stopped:
|
||||||
return
|
return
|
||||||
for lilypad: Lilypad in lilypads:
|
for lilypad: Lilypad in lilypads:
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
@tool
|
@tool
|
||||||
extends TextureRect
|
extends TextureRect
|
||||||
|
|
||||||
|
class_name River
|
||||||
|
|
||||||
const water_ring_scene: PackedScene = preload("res://sources/utils/fx/water_ring.tscn")
|
const water_ring_scene: PackedScene = preload("res://sources/utils/fx/water_ring.tscn")
|
||||||
|
|
||||||
func spawn_water_ring(pos: Vector2) -> void:
|
func spawn_water_ring(pos: Vector2) -> void:
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ var stimulus: Dictionary :
|
|||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
button.set_drag_forwarding(_get_drag_data, _can_drop_data, _drop_data)
|
(button as Control).set_drag_forwarding(_get_drag_data, _can_drop_data, _drop_data)
|
||||||
|
|
||||||
|
|
||||||
func _on_button_pressed() -> void:
|
func _on_button_pressed() -> void:
|
||||||
|
|||||||
@@ -539,6 +539,7 @@ _data = {
|
|||||||
[sub_resource type="GDScript" id="GDScript_fxkfh"]
|
[sub_resource type="GDScript" id="GDScript_fxkfh"]
|
||||||
script/source = "extends Button
|
script/source = "extends Button
|
||||||
|
|
||||||
|
@warning_ignore(\"UNUSED_SIGNAL\")
|
||||||
signal dragging()
|
signal dragging()
|
||||||
|
|
||||||
@onready var drag_preview_model: = $DragPreview
|
@onready var drag_preview_model: = $DragPreview
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ func _on_coconut_thrown(monkey: Monkey) -> void:
|
|||||||
_log_new_response_and_score(monkey.stimulus)
|
_log_new_response_and_score(monkey.stimulus)
|
||||||
|
|
||||||
is_locked = true
|
is_locked = true
|
||||||
var coconut: = await _get_coconut_from_monkey_to_king(monkey)
|
var coconut: Coconut = await _get_coconut_from_monkey_to_king(monkey)
|
||||||
|
|
||||||
# All monkeys talk but the sound is from a specific monkey
|
# All monkeys talk but the sound is from a specific monkey
|
||||||
var coroutine: = Coroutine.new()
|
var coroutine: = Coroutine.new()
|
||||||
@@ -239,13 +239,14 @@ func _on_current_progression_changed() -> void:
|
|||||||
var coroutine: = Coroutine.new()
|
var coroutine: = Coroutine.new()
|
||||||
for monkey in monkeys:
|
for monkey in monkeys:
|
||||||
coroutine.add_future(monkey.talk)
|
coroutine.add_future(monkey.talk)
|
||||||
audio_player.play_word(_get_previous_stimulus().Word)
|
audio_player.play_word(_get_previous_stimulus().Word as String)
|
||||||
if audio_player.playing:
|
if audio_player.playing:
|
||||||
coroutine.add_future(audio_player.finished)
|
coroutine.add_future(audio_player.finished)
|
||||||
await coroutine.join_all()
|
await coroutine.join_all()
|
||||||
await get_tree().create_timer(time_between_words/2).timeout
|
await get_tree().create_timer(time_between_words/2).timeout
|
||||||
|
|
||||||
# Starts a new round
|
# Starts a new round
|
||||||
|
@warning_ignore("redundant_await")
|
||||||
await super()
|
await super()
|
||||||
|
|
||||||
# Reset the label
|
# Reset the label
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ var is_pressed: bool = false
|
|||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
if gp:
|
if gp:
|
||||||
if capitalized:
|
if capitalized:
|
||||||
text = gp.Grapheme.capitalize()
|
text = (gp.Grapheme as String).capitalize()
|
||||||
else:
|
else:
|
||||||
text = gp.Grapheme
|
text = gp.Grapheme
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ func _setup_minigame() -> void:
|
|||||||
# Setups the timer
|
# Setups the timer
|
||||||
spawn_timer.wait_time = settings.spawn_rate
|
spawn_timer.wait_time = settings.spawn_rate
|
||||||
|
|
||||||
for s in stimuli:
|
for s: Dictionary in stimuli:
|
||||||
print(s.Word)
|
print(s.Word)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
extends Control
|
extends Control
|
||||||
class_name WaterRingFX
|
class_name WaterRingFX
|
||||||
|
|
||||||
@export_range(1, 10) var min: int = 1
|
@export_range(1, 10) var min_particle: int = 1
|
||||||
@export_range(1, 10) var max: int = 4
|
@export_range(1, 10) var max_particle: int = 4
|
||||||
|
|
||||||
@onready var particles: GPUParticles2D = $GPUParticles2D
|
@onready var particles: GPUParticles2D = $GPUParticles2D
|
||||||
|
|
||||||
func play() -> void:
|
func play() -> void:
|
||||||
particles.amount = randi_range(min, max)
|
particles.amount = randi_range(min_particle, max_particle)
|
||||||
particles.restart()
|
particles.restart()
|
||||||
await particles.finished
|
await particles.finished
|
||||||
|
|||||||
@@ -8,28 +8,28 @@ signal swipe(start_position: Vector2, end_position: Vector2)
|
|||||||
var current_preview: TextureRect
|
var current_preview: TextureRect
|
||||||
var start_position: Vector2
|
var start_position: Vector2
|
||||||
|
|
||||||
func _ready():
|
func _ready() -> void :
|
||||||
set_drag_forwarding(
|
set_drag_forwarding(
|
||||||
# _get_drag_data
|
# _get_drag_data
|
||||||
func(at_position: Vector2):
|
func(at_position: Vector2) -> Dictionary:
|
||||||
current_preview = drag_preview.duplicate()
|
current_preview = drag_preview.duplicate()
|
||||||
current_preview.show()
|
current_preview.show()
|
||||||
set_drag_preview(current_preview)
|
set_drag_preview(current_preview)
|
||||||
start_position = global_position + at_position
|
start_position = global_position + at_position
|
||||||
return {},
|
return {},
|
||||||
# _can_drop_data
|
# _can_drop_data
|
||||||
func(_at_position: Vector2, _data):
|
func(_at_position: Vector2, _data: Variant) -> bool:
|
||||||
return false,
|
return false,
|
||||||
# _drop_data
|
# _drop_data
|
||||||
func(at_position: Vector2, data):
|
func(_at_position: Vector2, _data: Variant) -> void:
|
||||||
pass
|
pass
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
func _on_drag_preview_tree_exiting():
|
func _on_drag_preview_tree_exiting() -> void:
|
||||||
if current_preview:
|
if current_preview:
|
||||||
swipe.emit(start_position, current_preview.global_position)
|
swipe.emit(start_position, current_preview.global_position)
|
||||||
|
|
||||||
|
|
||||||
func _on_drag_preview_tree_exited():
|
func _on_drag_preview_tree_exited() -> void:
|
||||||
current_preview = null
|
current_preview = null
|
||||||
|
|||||||
Reference in New Issue
Block a user