This commit is contained in:
Adrien Ufferte
2025-06-17 16:42:31 +02:00
parent 52fc4f0e62
commit 6be4e67b50
19 changed files with 38 additions and 38 deletions
+2 -2
View File
@@ -9,9 +9,9 @@ const PACKAGE_LOADER_SCENE_PATH: String = "res://sources/menus/language_selectio
@onready var teacher_label : Label = $Informations/TeacherValue
@onready var device_id_label : Label = $Informations/DeviceIDValue
@onready var kalulu : KALULU = $Kalulu
@onready var kalulu: KALULU = $Kalulu
@onready var play_button: Button = %PlayButton
@onready var interface_left : MarginContainer = %InterfaceLeft
@onready var interface_left: MarginContainer = %InterfaceLeft
@onready var keyboard_spacer: KeyboardSpacer = %KeyboardSpacer
@onready var no_internet_popup: ConfirmPopup = $NoInternetPopup
@@ -55,13 +55,13 @@ func _find_stimuli_and_distractions() -> void:
stimuli.append_array(current_lesson_words)
# If there are not enough stimuli from current lesson, we want at least half the target number of stimuli
var minimal_stimuli : int = floori(current_lesson_stimuli_number/2.0)
var minimal_stimuli: int = floori(current_lesson_stimuli_number/2.0)
if stimuli.size() < minimal_stimuli:
while stimuli.size() < minimal_stimuli:
stimuli.append(current_lesson_words.pick_random())
# Gets other stimuli from previous errors or lessons
var spaces_left : int = max_progression - stimuli.size()
var spaces_left: int = max_progression - stimuli.size()
if previous_lesson_words.size() >= spaces_left:
for index: int in spaces_left:
stimuli.append(previous_lesson_words[index])
+1 -1
View File
@@ -51,7 +51,7 @@ func _process(delta: float) -> void:
func spawn_berry(gp: Dictionary, is_distractor: bool) -> void:
var berry : Berry = BERRY_SCENE.instantiate()
var berry: Berry = BERRY_SCENE.instantiate()
berries.add_child(berry)
berry.gp = gp
berry.is_distractor = is_distractor
+2 -2
View File
@@ -91,9 +91,9 @@ func _on_button_pressed() -> void:
func _on_animated_sprite_2d_animation_finished() -> void:
match animated_sprite.animation:
"idle1", "idle2":
if randf() < 0.5 :
if randf() < 0.5:
animated_sprite.play("idle1")
else :
else:
animated_sprite.play("idle2")
"hit":
animated_sprite.play("hurt")
+2 -2
View File
@@ -129,7 +129,7 @@ func _spawn_crabs() -> void:
await get_tree().create_timer(0.1).timeout
func _on_hole_crab_out(hole : Hole) -> void:
func _on_hole_crab_out(hole: Hole) -> void:
if is_highlighting and _is_stimulus_right(hole.crab.stimulus):
hole.highlight()
@@ -158,7 +158,7 @@ func _on_hole_timer_timeout() -> void:
stimulus_spawned = true
holes[index].spawn_crab(_get_current_stimulus(), true)
else:
var current_distractors : Array = distractions[current_progression % distractions.size()]
var current_distractors: Array = distractions[current_progression % distractions.size()]
holes[index].spawn_crab(current_distractors.pick_random() as Dictionary, false)
hole_found = true
break
+3 -3
View File
@@ -16,7 +16,7 @@ const CRAB_SCENE: PackedScene = preload("res://sources/minigames/crabs/crab/crab
@onready var crab_audio_stream_player: HoleAudioStreamPlayer = $CrabAudioStreamPlayer2D
var crab: Crab
var crab_x : float
var crab_x: float
var stimulus_heard: bool = false:
set(value):
stimulus_heard = value
@@ -28,7 +28,7 @@ var crab_visible: bool = false:
var is_stimulus: bool = false
func _process(_delta : float) -> void:
func _process(_delta: float) -> void:
if not crab:
if sand_vfx.is_playing:
sand_vfx.stop()
@@ -111,7 +111,7 @@ func spawn_crab(gp: Dictionary, p_is_stimulus: bool) -> void:
crab_despawned.emit(p_is_stimulus)
func is_button_pressed_with_limit(future : Signal) -> bool:
func is_button_pressed_with_limit(future: Signal) -> bool:
var coroutine: Coroutine = Coroutine.new()
coroutine.add_future(crab.is_button_pressed)
coroutine.add_future(_is_stopped)
@@ -60,7 +60,7 @@ func _stop_highlight() -> void:
func _spawn() -> void:
# Instantiate a new jellyfish
var new_jellyfish : Jellyfish = JELLYFISH_SCENE.instantiate()
var new_jellyfish: Jellyfish = JELLYFISH_SCENE.instantiate()
spawning_space.add_child(new_jellyfish)
# Find the right size for the jellyfish
@@ -85,7 +85,7 @@ func _spawn() -> void:
if is_highlighting:
new_jellyfish.highlight()
else:
var current_distractors : Array = distractions[current_progression % distractions.size()]
var current_distractors: Array = distractions[current_progression % distractions.size()]
new_jellyfish.stimulus = current_distractors.pick_random()
# Randomize the spawn and adds the jellyfish into the scene
+1 -1
View File
@@ -6,7 +6,7 @@ class_name Coconut
@onready var label: Label = $Label
@onready var broken_coconut_fx: BrokenCoconutFX = $BrokenCoconutFX
var text: String :
var text: String:
set(value):
text = value
if label:
@@ -46,11 +46,11 @@ var selected: Array[Parakeet] = []
var state: State = State.Locked
const DIFFICULTY_SETTINGS: Dictionary[int, Dictionary] = {
0 : {"pairs_count": 2},
1 : {"pairs_count": 3},
2 : {"pairs_count": 4},
3 : {"pairs_count": 5},
4 : {"pairs_count": 6},
0: {"pairs_count": 2},
1: {"pairs_count": 3},
2: {"pairs_count": 4},
3: {"pairs_count": 5},
4: {"pairs_count": 6},
}
@@ -46,13 +46,13 @@ func _find_stimuli_and_distractions() -> void:
stimuli.append_array(current_lesson_sentences)
# If there are not enough stimuli from current lesson, we want at least half the target number of stimuli
var minimal_stimuli : int = floori(current_lesson_stimuli_number/2.0)
var minimal_stimuli: int = floori(current_lesson_stimuli_number/2.0)
if stimuli.size() < minimal_stimuli:
while stimuli.size() < minimal_stimuli:
stimuli.append(current_lesson_sentences.pick_random())
# Gets other stimuli from previous errors or lessons
var spaces_left : int = max_progression - stimuli.size()
var spaces_left: int = max_progression - stimuli.size()
if previous_lesson_sentences.size() >= spaces_left:
for index: int in spaces_left:
stimuli.append(previous_lesson_sentences[index])
+1 -1
View File
@@ -1,7 +1,7 @@
extends Area2D
class_name Island
@onready var label : Label = $Label
@onready var label: Label = $Label
@onready var collision: CollisionPolygon2D = $CollisionPolygon2D
var stimulus: Dictionary = {}:
+1 -1
View File
@@ -40,7 +40,7 @@ func _set_direction(new_direction: Vector2) -> void:
is_changing_direction = true
# Get the angle difference between the old and new direction
var angle_to : float = rad_to_deg(direction.angle_to(new_direction))
var angle_to: float = rad_to_deg(direction.angle_to(new_direction))
# Calculate the new angle of the body - this allows to get the closest angle for tweening
var angle: float = body.rotation_degrees + rad_to_deg(direction.angle_to(new_direction))
+1 -1
View File
@@ -87,7 +87,7 @@ func get_user_data() -> Dictionary:
func update_student_remediation_data(student_code: int, student_remediation: UserRemediation) -> Dictionary:
if not student_remediation:
Logger.trace("ServerManager: Cannot update studient remediation data because data does not exists")
Logger.trace("ServerManager: Cannot update student remediation data because data does not exists")
success = true
code = -1
json = {}
@@ -289,7 +289,7 @@ func _apply_server_response(response_body: Dictionary) -> void:
var new_scores: Dictionary[int, int] = {}
for index: int in new_array.size():
# TODO ADD SECURITY
new_scores[int(new_array[index][0])] = int(new_array[index][1])
new_scores[int(new_array[index][0] as float)] = int(new_array[index][1] as float)
UserDataManager.set_student_remediation_data(int(response_student_code), new_scores, response_student_data.remediation_gp.updated_at as String)