Cleaning
This commit is contained in:
@@ -24,11 +24,11 @@ enum Type {
|
||||
@export var minigame_number: int = 1
|
||||
|
||||
@export_category("Difficulty")
|
||||
@export var max_number_of_lives: int = 0 :
|
||||
@export var max_number_of_lives: int = 0:
|
||||
set(value):
|
||||
max_number_of_lives = value
|
||||
|
||||
@export var max_progression: int = 0 :
|
||||
@export var max_progression: int = 0:
|
||||
set(value):
|
||||
max_progression = value
|
||||
if minigame_ui:
|
||||
@@ -68,7 +68,7 @@ var stimuli: Array = []
|
||||
var distractions: Array = []
|
||||
|
||||
# Lives
|
||||
var current_lives: int = 0 :
|
||||
var current_lives: int = 0:
|
||||
set(value):
|
||||
var previous_lives: int = current_lives
|
||||
current_lives = value
|
||||
@@ -82,7 +82,7 @@ var current_lives: int = 0 :
|
||||
is_highlighting = true
|
||||
|
||||
# Progression
|
||||
var current_progression: int = 0 : set = set_current_progression
|
||||
var current_progression: int = 0: set = set_current_progression
|
||||
var current_number_of_hints: int = 0
|
||||
var consecutive_errors: int = 0
|
||||
var is_highlighting: bool = false:
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
extends Minigame
|
||||
class_name SyllablesMinigame
|
||||
|
||||
signal stimulus_heard(is_heard : bool)
|
||||
signal stimulus_heard(is_heard: bool)
|
||||
signal stimulus_found()
|
||||
|
||||
# Time before a new stimulus when the previous one is found
|
||||
@export var between_stimuli_time : float = 2.
|
||||
@export var between_stimuli_time: float = 2.
|
||||
# Time before the current stimulus is repeated
|
||||
@export var stimulus_repeat_time : float = 15
|
||||
@export var stimulus_repeat_time: float = 15
|
||||
|
||||
@onready var stimulus_timer: Timer = $StimulusTimer
|
||||
|
||||
@@ -69,13 +69,13 @@ func _find_stimuli_and_distractions() -> void:
|
||||
|
||||
# If there are not enough stimuli from current lesson, we want at least half the target number of stimuli
|
||||
@warning_ignore("integer_division")
|
||||
var minimal_stimuli : int = current_lesson_stimuli_number/2
|
||||
var minimal_stimuli: int = current_lesson_stimuli_number/2
|
||||
if stimuli.size() < minimal_stimuli:
|
||||
while stimuli.size() < minimal_stimuli:
|
||||
stimuli.append(current_lesson_stimuli.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_stimuli.size() >= spaces_left:
|
||||
for index: int in spaces_left:
|
||||
stimuli.append(previous_lesson_stimuli[index])
|
||||
@@ -146,7 +146,7 @@ func _is_stimulus_found() -> bool:
|
||||
return true
|
||||
|
||||
|
||||
func _is_stimulus_right(stimulus : Dictionary) -> bool:
|
||||
func _is_stimulus_right(stimulus: Dictionary) -> bool:
|
||||
var current_stimulus: Dictionary = _get_current_stimulus()
|
||||
return stimulus == current_stimulus
|
||||
|
||||
@@ -165,7 +165,7 @@ func _play_current_stimulus_phoneme() -> void:
|
||||
stimulus_timer.start()
|
||||
|
||||
|
||||
func _await_for_future_or_stimulus_found(future : Signal) -> bool:
|
||||
func _await_for_future_or_stimulus_found(future: Signal) -> bool:
|
||||
var coroutine: Coroutine = Coroutine.new()
|
||||
coroutine.add_future(_is_stimulus_found)
|
||||
coroutine.add_future(future)
|
||||
@@ -179,7 +179,7 @@ func _await_for_future_or_stimulus_found(future : Signal) -> bool:
|
||||
# ------------ Connections ------------
|
||||
|
||||
|
||||
func _on_stimulus_pressed(stimulus : Dictionary, _node : Node) -> bool:
|
||||
func _on_stimulus_pressed(stimulus: Dictionary, _node: Node) -> bool:
|
||||
if not is_stimulus_heard:
|
||||
return false
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ func walk() -> void:
|
||||
body_part.walk()
|
||||
|
||||
|
||||
func move(distance : float) -> void:
|
||||
func move(distance: float) -> void:
|
||||
if is_moving or is_eating:
|
||||
return
|
||||
|
||||
@@ -105,7 +105,7 @@ func eat_berry(berry: Berry) -> void:
|
||||
func spit_berry(berry: Berry) -> void:
|
||||
is_eating = true
|
||||
|
||||
var pos_x : float = berry.global_position.x
|
||||
var pos_x: float = berry.global_position.x
|
||||
|
||||
# Eat the berry
|
||||
var tween: Tween = create_tween()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extends Control
|
||||
class_name SpitVFX
|
||||
|
||||
@onready var particles : GPUParticles2D = $Particles
|
||||
@onready var particles: GPUParticles2D = $Particles
|
||||
|
||||
func play() -> void:
|
||||
particles.amount = randi_range(5, 8)
|
||||
|
||||
@@ -150,7 +150,7 @@ func wrong() -> void:
|
||||
crab.wrong()
|
||||
|
||||
|
||||
func _set_crab_button_active(is_active : bool) -> void:
|
||||
func _set_crab_button_active(is_active: bool) -> void:
|
||||
if crab:
|
||||
crab.set_button_active(is_active)
|
||||
|
||||
@@ -182,7 +182,7 @@ func _on_crab_hit(stimulus: Dictionary) -> void:
|
||||
crab = null
|
||||
|
||||
|
||||
func on_stimulus_heard(is_heard : bool) -> void:
|
||||
func on_stimulus_heard(is_heard: bool) -> void:
|
||||
stimulus_heard = is_heard
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[ext_resource type="Script" uid="uid://b5own5tlvbofc" path="res://sources/minigames/jellyfish/jellyfish_minigame.gd" id="2_gnjlp"]
|
||||
[ext_resource type="Texture2D" uid="uid://c0shai0eqdrbf" path="res://assets/minigames/jellyfish/graphic/gauge_icon_jellyfish_empty.png" id="4_1m7js"]
|
||||
[ext_resource type="Texture2D" uid="uid://cq87j1xw4c31r" path="res://assets/minigames/jellyfish/graphic/gauge_icon_jellyfish_full.png" id="5_4gwjw"]
|
||||
[ext_resource type="Texture2D" uid="uid://c7oq86cgq7okn" path="res://assets/minigames/jellyfish/graphic/backgroung.png" id="6_sn7hv"]
|
||||
[ext_resource type="Texture2D" uid="uid://c7oq86cgq7okn" path="res://assets/minigames/jellyfish/graphic/background.png" id="6_sn7hv"]
|
||||
|
||||
[node name="JellyfishMinigame" instance=ExtResource("1_hauef")]
|
||||
script = ExtResource("2_gnjlp")
|
||||
|
||||
Reference in New Issue
Block a user