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:
|
||||
# fattori lineari di tempo e punteggio
|
||||
var tf := clampf(elapsed / Settings.time_ramp, 0.0, 1.0)
|
||||
# La difficoltà (e quindi la velocità massima) è legata unicamente al punteggio
|
||||
var sf := clampf(score / Settings.score_ramp, 0.0, 1.0)
|
||||
# curva dolce: smoothstep rende l'accelerazione quasi impercettibile all'inizio
|
||||
return _smoothstep(maxf(tf, sf))
|
||||
return _smoothstep(sf)
|
||||
|
||||
|
||||
func _combo_decay() -> float:
|
||||
@@ -407,17 +405,9 @@ func _combo_decay() -> float:
|
||||
|
||||
|
||||
func _points_for_combo() -> int:
|
||||
# Punti per un tap corretto, in base alla curva selezionata nelle Opzioni.
|
||||
match Settings.score_curve:
|
||||
1: # scaglioni: +0.5x ogni 5 tap di 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)
|
||||
# Punti per lancio = combo corrente × valore punto configurato.
|
||||
# Es. combo 5 × 1 = 5 pt; combo 1 × 1 = 1 pt. Il valore punto è configurabile.
|
||||
return int(combo) * Settings.points_per_combo
|
||||
|
||||
|
||||
func _smoothstep(x: float) -> float:
|
||||
|
||||
+1
-25
@@ -4,7 +4,6 @@ extends CanvasLayer
|
||||
## scena applicando i nuovi valori.
|
||||
|
||||
var rows := {} # key -> {slider, spin}
|
||||
var curve_option: OptionButton
|
||||
var zen_cb: CheckButton
|
||||
var gentle_cb: CheckButton
|
||||
|
||||
@@ -52,8 +51,7 @@ func _build() -> void:
|
||||
var entries := [
|
||||
["start_time", "Tempo iniziale (s)", 1.0, 10.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", "Rampa punteggio", 100.0, 10000.0, 100.0],
|
||||
["score_ramp", "Punteggio per velocità max", 100.0, 20000.0, 100.0],
|
||||
["points_per_combo", "Punti per combo", 1.0, 50.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],
|
||||
@@ -63,24 +61,6 @@ func _build() -> void:
|
||||
for e in entries:
|
||||
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
|
||||
zen_cb = CheckButton.new()
|
||||
zen_cb.text = "Modalità Zen (senza tempo)"
|
||||
@@ -156,8 +136,6 @@ func show_menu() -> void:
|
||||
var val: float = Settings.get(key)
|
||||
rows[key].slider.value = val
|
||||
rows[key].spin.value = val
|
||||
if curve_option:
|
||||
curve_option.select(Settings.score_curve)
|
||||
if zen_cb:
|
||||
zen_cb.button_pressed = Settings.zen_mode
|
||||
if gentle_cb:
|
||||
@@ -183,8 +161,6 @@ func _on_reset() -> void:
|
||||
var val: float = Settings.get(key)
|
||||
rows[key].slider.value = val
|
||||
rows[key].spin.value = val
|
||||
if curve_option:
|
||||
curve_option.select(Settings.score_curve)
|
||||
if zen_cb:
|
||||
zen_cb.button_pressed = Settings.zen_mode
|
||||
if gentle_cb:
|
||||
|
||||
+5
-14
@@ -4,20 +4,17 @@ extends Node
|
||||
## al riavvio della scena.
|
||||
|
||||
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 start_time := 4.5 # tempo iniziale (s) tra un ordine e l'altro
|
||||
var min_time := 0.8 # tempo minimo (velocità massima)
|
||||
var time_ramp := 180.0 # secondi di gioco per difficoltà piena
|
||||
var score_ramp := 2000.0 # punteggio per difficoltà piena
|
||||
var points_per_combo := 10 # punti base per ogni livello di combo
|
||||
var score_ramp := 8000.0 # punteggio per difficoltà piena (velocità massima)
|
||||
var points_per_combo := 1 # punti per ogni lancio corretto (lineare, default 1)
|
||||
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_rate := 0.15 # combo persi al secondo per unità sopra la soglia
|
||||
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
|
||||
var gentle_errors := true # errore: combo -1 invece di azzerare
|
||||
var zen_mode := false # modalità senza tempo (niente countdown né decay)
|
||||
@@ -39,14 +36,12 @@ func load_settings() -> void:
|
||||
return
|
||||
start_time = cfg.get_value("gameplay", "start_time", start_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)
|
||||
points_per_combo = cfg.get_value("gameplay", "points_per_combo", points_per_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_rate = cfg.get_value("gameplay", "combo_decay_rate", combo_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)
|
||||
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("gameplay", "start_time", start_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", "points_per_combo", points_per_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_rate", combo_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", "zen_mode", zen_mode)
|
||||
cfg.save(PATH)
|
||||
@@ -72,13 +65,11 @@ func save_settings() -> void:
|
||||
func reset_defaults() -> void:
|
||||
start_time = 4.5
|
||||
min_time = 0.8
|
||||
time_ramp = 180.0
|
||||
score_ramp = 2000.0
|
||||
points_per_combo = 10
|
||||
score_ramp = 8000.0
|
||||
points_per_combo = 1
|
||||
max_combo = 5.0
|
||||
combo_decay_threshold = 0.0
|
||||
combo_decay_rate = 0.15
|
||||
difficulty_decay_rate = 0.3
|
||||
score_curve = 0
|
||||
gentle_errors = true
|
||||
zen_mode = false
|
||||
|
||||
Reference in New Issue
Block a user