Initial commit: Transcience MVP
Top-down twin-stick bullet-hell, Godot 4.7, server-authoritative dedicated server with client-side prediction. Clients send input only; the server resolves every hit for both players and enemies (no PvP). - SimWorld: whole simulation as plain RefCounted objects (no nodes, no physics server), ~0.24ms/tick at peak load -- runs headless for free and drives 78 tests in under a second - BulletPool: struct-of-arrays bullet storage, replicated as spawn/despawn events rather than per-tick state - Emitter framework (Ring/AimedSpread/WallGap/ArcSweep) shared by trash enemies and bosses -- a new boss is data in src/content/content.gd, no simulation changes - The Warden of the Fold: stationary 4-phase boss built entirely on that format - Lobby hub with a portal into on-demand dungeon instances; one process hosts the hub plus every concurrent dungeon - Emergency escape: 3s server-owned channel, cancelled by damage - tools/check.sh, test.sh (GUT), smoke.sh (real server + bot clients over ENet), bench.gd; git hooks wired to the same scripts - docs/ARCHITECTURE.md, NETCODE.md, WORKFLOW.md, ROADMAP.md
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
class_name SimBoss
|
||||
extends RefCounted
|
||||
## A boss instance. All fight-specific behaviour lives in its [BossDef]; this
|
||||
## class only advances the phase timeline.
|
||||
|
||||
var id: int = 0
|
||||
var def: BossDef
|
||||
var pos := Vector2.ZERO
|
||||
var hp: int = 1
|
||||
var alive: bool = true
|
||||
var phase_index: int = 0
|
||||
## Ticks since entering the current phase.
|
||||
var phase_tick: int = 0
|
||||
|
||||
|
||||
func hp_fraction() -> float:
|
||||
if def == null or def.max_hp <= 0:
|
||||
return 0.0
|
||||
return float(hp) / float(def.max_hp)
|
||||
|
||||
|
||||
func current_phase() -> BossPhase:
|
||||
if def == null or def.phases.is_empty():
|
||||
return null
|
||||
return def.phases[clampi(phase_index, 0, def.phases.size() - 1)]
|
||||
Reference in New Issue
Block a user