- services/scores-api: microservizio (solo stdlib) con SQLite WAL, idempotenza per submission_id, limiti di frequenza e validazione; immagine Docker non-root. - nginx: reverse proxy su /api/zombie-fps/ (stessa origine del gioco, niente CORS). - scripts/leaderboard.gd: client HTTP con retry idempotente; su desktop la classifica resta disattivata senza --api=, cosi' i test non sporcano la classifica pubblica. - scripts/player_profile.gd: nome, id anonimo e miglior punteggio in user:// e in window.localStorage; il nome scelto non viene piu' richiesto; riparazione dei profili con la stringa "null". - scripts/start_screen.gd: menu con nome, GIOCA e classifica; la partita parte solo dal pulsante (via la rete di sicurezza sull'input, Invio nel campo non avvia). - scripts/main.gd, player.gd: avvio esplicito, segnale died, nota dell'invio. - tools: test_scores_api.py (42), test_leaderboard (14), test_player_profile (21), test_start_screen (10); suite esistenti adeguate all'avvio manuale. - docs/HIGHSCORES.md + docs/WEB-DEPLOY.md aggiornati.
26 lines
1023 B
GDScript
26 lines
1023 B
GDScript
extends SceneTree
|
|
func _initialize() -> void:
|
|
call_deferred("run_test")
|
|
func run_test() -> void:
|
|
var world = load("res://scenes/main.tscn").instantiate()
|
|
root.add_child(world)
|
|
world.start_game("Test", false) # come premere GIOCA, senza toccare il profilo salvato
|
|
world.player.hp = 100000
|
|
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
|
await create_timer(5.2).timeout
|
|
assert(world.wave == 1 and world.alive == 6 and not world.spawning)
|
|
for zombie in get_nodes_in_group("live_zombies"):
|
|
zombie.take_damage(1000, zombie.global_position.y + 0.9)
|
|
assert(world.alive == 0 and world.wave_pending)
|
|
world._check_wave()
|
|
world._check_wave() # no duplicate next-wave scheduling
|
|
await create_timer(3.2).timeout
|
|
assert(world.wave == 2)
|
|
await create_timer(6.4).timeout
|
|
assert(world.wave == 2 and world.alive == 8 and not world.spawning)
|
|
assert(get_nodes_in_group("zombie_corpses").size() == 6)
|
|
print("PASS: wave1=6, clear -> wave2=8, single transition, corpses retained")
|
|
world.queue_free()
|
|
await process_frame
|
|
quit()
|