Compose buildings from definitions and capabilities

This commit is contained in:
Loïc Wisniewski 2026-08-14 21:44:28 +02:00
commit 0504b24d8d
46 changed files with 1091 additions and 878 deletions

View file

@ -57,16 +57,19 @@ func _process(delta: float) -> bool:
# Spawning is deferred, so give the tree a frame to attach them.
if elapsed < 0.2:
return false
crafter = _find(GameState.BUILDING_SHIP_CRAFTER)
if crafter == null:
var crafter_building: Node2D = _find(GameState.BUILDING_SHIP_CRAFTER)
if crafter_building == null:
print("TEST_CRAFTER_ANIMATION: FAIL (crafter never spawned)")
quit(1)
return true
crafter = crafter_building.visual
var animated: bool = crafter.is_processing()
var mothership: Node2D = _find(GameState.BUILDING_MOTHERSHIP)
var mothership_building: Node2D = _find(GameState.BUILDING_MOTHERSHIP)
var mothership: Node2D = mothership_building.visual if mothership_building != null else null
var mothership_animates: bool = mothership != null and mothership.is_processing()
var command: Node2D = _find(GameState.BUILDING_COMMAND_CENTER)
var command_building: Node2D = _find(GameState.BUILDING_COMMAND_CENTER)
var command: Node2D = command_building.visual if command_building != null else null
var command_static: bool = command != null and not command.is_processing()
print("crafter animates=%s mothership animates=%s command centre static=%s" % [
animated, mothership_animates, command_static