Add settings screen and adult space with progress report and save export/restore (0.4.0)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Denis Defolie
2026-10-11 22:49:01 +02:00
parent 97a065879c
commit dbf513e686
45 changed files with 1390 additions and 14 deletions
+24
View File
@@ -0,0 +1,24 @@
class_name AdultGate
extends RefCounted
## Petite barriere devant l'espace adulte : un calcul qu'un enfant de CE1-CE2
## ne fait pas facilement de tete (produit d'un nombre a deux chiffres par un
## chiffre). Ce n'est pas une protection de securite, seulement un frein
## contre un clic par curiosite. Le hasard est injecte, jamais lu ici.
const MIN_FACTOR_A := 12
const MAX_FACTOR_A := 19
const MIN_FACTOR_B := 3
const MAX_FACTOR_B := 9
static func make_challenge(rng: RandomNumberGenerator) -> Dictionary:
var a := rng.randi_range(MIN_FACTOR_A, MAX_FACTOR_A)
var b := rng.randi_range(MIN_FACTOR_B, MAX_FACTOR_B)
return {"a": a, "b": b, "answer": a * b}
static func is_correct(challenge: Dictionary, typed: String) -> bool:
var cleaned := typed.strip_edges()
if not cleaned.is_valid_int():
return false
return int(cleaned) == int(challenge["answer"])