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,55 @@
|
||||
var things = {}
|
||||
|
||||
func get_unique_count():
|
||||
return things.size()
|
||||
|
||||
|
||||
func add_thing_to_count(thing):
|
||||
if(!things.has(thing)):
|
||||
things[thing] = 0
|
||||
|
||||
|
||||
func add(thing):
|
||||
if(things.has(thing)):
|
||||
things[thing] += 1
|
||||
else:
|
||||
things[thing] = 1
|
||||
|
||||
|
||||
func has(thing):
|
||||
return things.has(thing)
|
||||
|
||||
|
||||
func count(thing):
|
||||
var to_return = 0
|
||||
if(things.has(thing)):
|
||||
to_return = things[thing]
|
||||
return to_return
|
||||
|
||||
|
||||
func sum():
|
||||
var to_return = 0
|
||||
for key in things:
|
||||
to_return += things[key]
|
||||
return to_return
|
||||
|
||||
|
||||
func to_s():
|
||||
var to_return = ""
|
||||
for key in things:
|
||||
to_return += str(key, ": ", things[key], "\n")
|
||||
to_return += str("sum: ", sum())
|
||||
return to_return
|
||||
|
||||
|
||||
func get_max_count():
|
||||
var max_val = null
|
||||
for key in things:
|
||||
if(max_val == null or things[key] > max_val):
|
||||
max_val = things[key]
|
||||
return max_val
|
||||
|
||||
|
||||
func add_array_items(array):
|
||||
for i in range(array.size()):
|
||||
add(array[i])
|
||||
Reference in New Issue
Block a user