Compose vessels from definitions and capabilities

This commit is contained in:
Loïc Wisniewski 2026-08-14 22:12:57 +02:00
commit 14081ad230
39 changed files with 705 additions and 386 deletions

View file

@ -1,8 +1,10 @@
extends Node2D
const VESSEL_DEFINITIONS = preload("res://VesselDefinitions.gd")
# Visual-only craft-to-mothership flight. GameState owns position/progress;
# this node just renders a finished hull headed toward the hangar.
var vessel_type: String = GameState.VESSEL_INTERCEPTOR
var vessel_type: String = "interceptor"
func _ready() -> void:
@ -11,6 +13,6 @@ func _ready() -> void:
func _draw() -> void:
var color: Color = Color(0.45, 0.8, 1.0) if vessel_type == GameState.VESSEL_SHIELD else Color(0.95, 0.55, 0.85) if vessel_type == GameState.VESSEL_TRANSPORTER else Color(0.25, 0.85, 1.0)
var hull := PackedVector2Array([Vector2(0, -20), Vector2(13, 15), Vector2(0, 9), Vector2(-13, 15)])
NeonDraw.draw_glowing_polygon(self, hull, color, 1.0)
var definition: Resource = VESSEL_DEFINITIONS.get_definition(vessel_type)
if definition != null:
NeonDraw.draw_glowing_polygon(self, definition.hull_points, definition.glow_color, 1.0)