Score = combo x point value (configurable, default 1); difficulty score-only at 8000
This commit is contained in:
+5
-15
@@ -391,11 +391,9 @@ func _current_time() -> float:
|
|||||||
|
|
||||||
|
|
||||||
func _difficulty() -> float:
|
func _difficulty() -> float:
|
||||||
# fattori lineari di tempo e punteggio
|
# La difficoltà (e quindi la velocità massima) è legata unicamente al punteggio
|
||||||
var tf := clampf(elapsed / Settings.time_ramp, 0.0, 1.0)
|
|
||||||
var sf := clampf(score / Settings.score_ramp, 0.0, 1.0)
|
var sf := clampf(score / Settings.score_ramp, 0.0, 1.0)
|
||||||
# curva dolce: smoothstep rende l'accelerazione quasi impercettibile all'inizio
|
return _smoothstep(sf)
|
||||||
return _smoothstep(maxf(tf, sf))
|
|
||||||
|
|
||||||
|
|
||||||
func _combo_decay() -> float:
|
func _combo_decay() -> float:
|
||||||
@@ -407,17 +405,9 @@ func _combo_decay() -> float:
|
|||||||
|
|
||||||
|
|
||||||
func _points_for_combo() -> int:
|
func _points_for_combo() -> int:
|
||||||
# Punti per un tap corretto, in base alla curva selezionata nelle Opzioni.
|
# Punti per lancio = combo corrente × valore punto configurato.
|
||||||
match Settings.score_curve:
|
# Es. combo 5 × 1 = 5 pt; combo 1 × 1 = 1 pt. Il valore punto è configurabile.
|
||||||
1: # scaglioni: +0.5x ogni 5 tap di combo
|
return int(combo) * Settings.points_per_combo
|
||||||
var mult := 1.0 + floori(combo / 5.0) * 0.5
|
|
||||||
return int(Settings.points_per_combo * mult)
|
|
||||||
2: # radice quadrata
|
|
||||||
return int(Settings.points_per_combo * sqrt(combo))
|
|
||||||
3: # additiva: base + combo
|
|
||||||
return Settings.points_per_combo + int(combo)
|
|
||||||
_: # 0 = quadratica (attuale): base × combo
|
|
||||||
return Settings.points_per_combo * int(combo)
|
|
||||||
|
|
||||||
|
|
||||||
func _smoothstep(x: float) -> float:
|
func _smoothstep(x: float) -> float:
|
||||||
|
|||||||
+1
-25
@@ -4,7 +4,6 @@ extends CanvasLayer
|
|||||||
## scena applicando i nuovi valori.
|
## scena applicando i nuovi valori.
|
||||||
|
|
||||||
var rows := {} # key -> {slider, spin}
|
var rows := {} # key -> {slider, spin}
|
||||||
var curve_option: OptionButton
|
|
||||||
var zen_cb: CheckButton
|
var zen_cb: CheckButton
|
||||||
var gentle_cb: CheckButton
|
var gentle_cb: CheckButton
|
||||||
|
|
||||||
@@ -52,8 +51,7 @@ func _build() -> void:
|
|||||||
var entries := [
|
var entries := [
|
||||||
["start_time", "Tempo iniziale (s)", 1.0, 10.0, 0.1],
|
["start_time", "Tempo iniziale (s)", 1.0, 10.0, 0.1],
|
||||||
["min_time", "Tempo minimo (s)", 0.3, 3.0, 0.1],
|
["min_time", "Tempo minimo (s)", 0.3, 3.0, 0.1],
|
||||||
["time_ramp", "Rampa tempo (s)", 30.0, 600.0, 10.0],
|
["score_ramp", "Punteggio per velocità max", 100.0, 20000.0, 100.0],
|
||||||
["score_ramp", "Rampa punteggio", 100.0, 10000.0, 100.0],
|
|
||||||
["points_per_combo", "Punti per combo", 1.0, 50.0, 1.0],
|
["points_per_combo", "Punti per combo", 1.0, 50.0, 1.0],
|
||||||
["max_combo", "Combo massimo", 1.0, 20.0, 1.0],
|
["max_combo", "Combo massimo", 1.0, 20.0, 1.0],
|
||||||
["combo_decay_threshold", "Soglia decay combo", 0.0, 30.0, 1.0],
|
["combo_decay_threshold", "Soglia decay combo", 0.0, 30.0, 1.0],
|
||||||
@@ -63,24 +61,6 @@ func _build() -> void:
|
|||||||
for e in entries:
|
for e in entries:
|
||||||
rows[e[0]] = _build_row(vb, e[0], e[1], e[2], e[3], e[4])
|
rows[e[0]] = _build_row(vb, e[0], e[1], e[2], e[3], e[4])
|
||||||
|
|
||||||
# selettore curva punteggio
|
|
||||||
var ccurve := HBoxContainer.new()
|
|
||||||
ccurve.add_theme_constant_override("separation", 6)
|
|
||||||
vb.add_child(ccurve)
|
|
||||||
var clbl := Label.new()
|
|
||||||
clbl.text = "Curva punteggio"
|
|
||||||
clbl.custom_minimum_size.x = 230
|
|
||||||
ccurve.add_child(clbl)
|
|
||||||
curve_option = OptionButton.new()
|
|
||||||
curve_option.custom_minimum_size.x = 360
|
|
||||||
curve_option.add_item("Quadratica (attuale)")
|
|
||||||
curve_option.add_item("A scaglioni (ogni 5 tap)")
|
|
||||||
curve_option.add_item("Radice quadrata")
|
|
||||||
curve_option.add_item("Additiva (base + combo)")
|
|
||||||
curve_option.select(Settings.score_curve)
|
|
||||||
curve_option.item_selected.connect(func(idx: int): Settings.score_curve = idx)
|
|
||||||
ccurve.add_child(curve_option)
|
|
||||||
|
|
||||||
# opzioni accessibilità / neurodivergenza
|
# opzioni accessibilità / neurodivergenza
|
||||||
zen_cb = CheckButton.new()
|
zen_cb = CheckButton.new()
|
||||||
zen_cb.text = "Modalità Zen (senza tempo)"
|
zen_cb.text = "Modalità Zen (senza tempo)"
|
||||||
@@ -156,8 +136,6 @@ func show_menu() -> void:
|
|||||||
var val: float = Settings.get(key)
|
var val: float = Settings.get(key)
|
||||||
rows[key].slider.value = val
|
rows[key].slider.value = val
|
||||||
rows[key].spin.value = val
|
rows[key].spin.value = val
|
||||||
if curve_option:
|
|
||||||
curve_option.select(Settings.score_curve)
|
|
||||||
if zen_cb:
|
if zen_cb:
|
||||||
zen_cb.button_pressed = Settings.zen_mode
|
zen_cb.button_pressed = Settings.zen_mode
|
||||||
if gentle_cb:
|
if gentle_cb:
|
||||||
@@ -183,8 +161,6 @@ func _on_reset() -> void:
|
|||||||
var val: float = Settings.get(key)
|
var val: float = Settings.get(key)
|
||||||
rows[key].slider.value = val
|
rows[key].slider.value = val
|
||||||
rows[key].spin.value = val
|
rows[key].spin.value = val
|
||||||
if curve_option:
|
|
||||||
curve_option.select(Settings.score_curve)
|
|
||||||
if zen_cb:
|
if zen_cb:
|
||||||
zen_cb.button_pressed = Settings.zen_mode
|
zen_cb.button_pressed = Settings.zen_mode
|
||||||
if gentle_cb:
|
if gentle_cb:
|
||||||
|
|||||||
+5
-14
@@ -4,20 +4,17 @@ extends Node
|
|||||||
## al riavvio della scena.
|
## al riavvio della scena.
|
||||||
|
|
||||||
const PATH := "user://settings.cfg"
|
const PATH := "user://settings.cfg"
|
||||||
const VERSION := 3 # incrementa quando cambiano i default, per resettare i file vecchi
|
const VERSION := 5 # incrementa quando cambiano i default, per resettare i file vecchi
|
||||||
var version := VERSION
|
var version := VERSION
|
||||||
|
|
||||||
var start_time := 4.5 # tempo iniziale (s) tra un ordine e l'altro
|
var start_time := 4.5 # tempo iniziale (s) tra un ordine e l'altro
|
||||||
var min_time := 0.8 # tempo minimo (velocità massima)
|
var min_time := 0.8 # tempo minimo (velocità massima)
|
||||||
var time_ramp := 180.0 # secondi di gioco per difficoltà piena
|
var score_ramp := 8000.0 # punteggio per difficoltà piena (velocità massima)
|
||||||
var score_ramp := 2000.0 # punteggio per difficoltà piena
|
var points_per_combo := 1 # punti per ogni lancio corretto (lineare, default 1)
|
||||||
var points_per_combo := 10 # punti base per ogni livello di combo
|
|
||||||
var max_combo := 5.0 # combo massimo di default (configurabile)
|
var max_combo := 5.0 # combo massimo di default (configurabile)
|
||||||
var combo_decay_threshold := 0.0 # combo sopra cui inizia il decay (0 = da subito)
|
var combo_decay_threshold := 0.0 # combo sopra cui inizia il decay (0 = da subito)
|
||||||
var combo_decay_rate := 0.15 # combo persi al secondo per unità sopra la soglia
|
var combo_decay_rate := 0.15 # combo persi al secondo per unità sopra la soglia
|
||||||
var difficulty_decay_rate := 0.3 # decay aggiuntivo legato alla difficoltà
|
var difficulty_decay_rate := 0.3 # decay aggiuntivo legato alla difficoltà
|
||||||
# Curva del punteggio: 0=quadratica, 1=scaglioni, 2=radice, 3=additiva
|
|
||||||
var score_curve := 0
|
|
||||||
# Accessibilità / neurodivergenza
|
# Accessibilità / neurodivergenza
|
||||||
var gentle_errors := true # errore: combo -1 invece di azzerare
|
var gentle_errors := true # errore: combo -1 invece di azzerare
|
||||||
var zen_mode := false # modalità senza tempo (niente countdown né decay)
|
var zen_mode := false # modalità senza tempo (niente countdown né decay)
|
||||||
@@ -39,14 +36,12 @@ func load_settings() -> void:
|
|||||||
return
|
return
|
||||||
start_time = cfg.get_value("gameplay", "start_time", start_time)
|
start_time = cfg.get_value("gameplay", "start_time", start_time)
|
||||||
min_time = cfg.get_value("gameplay", "min_time", min_time)
|
min_time = cfg.get_value("gameplay", "min_time", min_time)
|
||||||
time_ramp = cfg.get_value("gameplay", "time_ramp", time_ramp)
|
|
||||||
score_ramp = cfg.get_value("gameplay", "score_ramp", score_ramp)
|
score_ramp = cfg.get_value("gameplay", "score_ramp", score_ramp)
|
||||||
points_per_combo = cfg.get_value("gameplay", "points_per_combo", points_per_combo)
|
points_per_combo = cfg.get_value("gameplay", "points_per_combo", points_per_combo)
|
||||||
max_combo = cfg.get_value("gameplay", "max_combo", max_combo)
|
max_combo = cfg.get_value("gameplay", "max_combo", max_combo)
|
||||||
combo_decay_threshold = cfg.get_value("gameplay", "combo_decay_threshold", combo_decay_threshold)
|
combo_decay_threshold = cfg.get_value("gameplay", "combo_decay_threshold", combo_decay_threshold)
|
||||||
combo_decay_rate = cfg.get_value("gameplay", "combo_decay_rate", combo_decay_rate)
|
combo_decay_rate = cfg.get_value("gameplay", "combo_decay_rate", combo_decay_rate)
|
||||||
difficulty_decay_rate = cfg.get_value("gameplay", "difficulty_decay_rate", difficulty_decay_rate)
|
difficulty_decay_rate = cfg.get_value("gameplay", "difficulty_decay_rate", difficulty_decay_rate)
|
||||||
score_curve = cfg.get_value("gameplay", "score_curve", score_curve)
|
|
||||||
gentle_errors = cfg.get_value("accessibility", "gentle_errors", gentle_errors)
|
gentle_errors = cfg.get_value("accessibility", "gentle_errors", gentle_errors)
|
||||||
zen_mode = cfg.get_value("accessibility", "zen_mode", zen_mode)
|
zen_mode = cfg.get_value("accessibility", "zen_mode", zen_mode)
|
||||||
|
|
||||||
@@ -56,14 +51,12 @@ func save_settings() -> void:
|
|||||||
cfg.set_value("meta", "version", VERSION)
|
cfg.set_value("meta", "version", VERSION)
|
||||||
cfg.set_value("gameplay", "start_time", start_time)
|
cfg.set_value("gameplay", "start_time", start_time)
|
||||||
cfg.set_value("gameplay", "min_time", min_time)
|
cfg.set_value("gameplay", "min_time", min_time)
|
||||||
cfg.set_value("gameplay", "time_ramp", time_ramp)
|
|
||||||
cfg.set_value("gameplay", "score_ramp", score_ramp)
|
cfg.set_value("gameplay", "score_ramp", score_ramp)
|
||||||
cfg.set_value("gameplay", "points_per_combo", points_per_combo)
|
cfg.set_value("gameplay", "points_per_combo", points_per_combo)
|
||||||
cfg.set_value("gameplay", "max_combo", max_combo)
|
cfg.set_value("gameplay", "max_combo", max_combo)
|
||||||
cfg.set_value("gameplay", "combo_decay_threshold", combo_decay_threshold)
|
cfg.set_value("gameplay", "combo_decay_threshold", combo_decay_threshold)
|
||||||
cfg.set_value("gameplay", "combo_decay_rate", combo_decay_rate)
|
cfg.set_value("gameplay", "combo_decay_rate", combo_decay_rate)
|
||||||
cfg.set_value("gameplay", "difficulty_decay_rate", difficulty_decay_rate)
|
cfg.set_value("gameplay", "difficulty_decay_rate", difficulty_decay_rate)
|
||||||
cfg.set_value("gameplay", "score_curve", score_curve)
|
|
||||||
cfg.set_value("accessibility", "gentle_errors", gentle_errors)
|
cfg.set_value("accessibility", "gentle_errors", gentle_errors)
|
||||||
cfg.set_value("accessibility", "zen_mode", zen_mode)
|
cfg.set_value("accessibility", "zen_mode", zen_mode)
|
||||||
cfg.save(PATH)
|
cfg.save(PATH)
|
||||||
@@ -72,13 +65,11 @@ func save_settings() -> void:
|
|||||||
func reset_defaults() -> void:
|
func reset_defaults() -> void:
|
||||||
start_time = 4.5
|
start_time = 4.5
|
||||||
min_time = 0.8
|
min_time = 0.8
|
||||||
time_ramp = 180.0
|
score_ramp = 8000.0
|
||||||
score_ramp = 2000.0
|
points_per_combo = 1
|
||||||
points_per_combo = 10
|
|
||||||
max_combo = 5.0
|
max_combo = 5.0
|
||||||
combo_decay_threshold = 0.0
|
combo_decay_threshold = 0.0
|
||||||
combo_decay_rate = 0.15
|
combo_decay_rate = 0.15
|
||||||
difficulty_decay_rate = 0.3
|
difficulty_decay_rate = 0.3
|
||||||
score_curve = 0
|
|
||||||
gentle_errors = true
|
gentle_errors = true
|
||||||
zen_mode = false
|
zen_mode = false
|
||||||
|
|||||||
Reference in New Issue
Block a user