spaceship/tests/_ingame_buildings_preview.gd
Loïc Wisniewski 1cbae8ff70 Ship Lab: per-vessel research, and the shield vessel
Forgejo #5. A new building gated behind a "Vessel Science" research
node. Its own screen upgrades each vessel type - weapon, movement,
shield and freight - and unlocks the shield vessel, which the ship
crafter can then build.

Vessel research is deliberately NOT more nodes in the mothership tree:
that tree gates what may be built at all and is a strategic spine, while
these are repeatable tuning on vessels already owned. Levels cost
base * (level + 1), so the third point in something is not the price of
the first. Upgrades are read live rather than baked in at build time, so
researching one improves the ships already flying.

The shield is personal, not a bubble: it absorbs a hit that would
destroy the vessel - ships have no health, contact kills - and is then
down until it cycles. Its ring is a NeonPiece child toggled with
`visible` per #10, not a redraw of the hull.

The build menu now holds six entries across three rows, which the #21
repacking already handles.

Enemies still have no weapon, so "blocks shots" has nothing to block
yet; that is filed separately rather than widened into this ticket.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 23:31:49 +02:00

29 lines
1.3 KiB
GDScript

extends Node2D
# Preview scene - NOT run by run_tests.sh (underscore prefix). Renders the
# buildings through the REAL game path: records in GameState, spawned by
# Main.tscn's BuildingField, drawn under the game's own camera. The sibling
# _crafter_preview only proves Building.gd's art in isolation; this proves
# what actually reaches the screen in a running game.
#
# bash tests/screenshot.sh res://tests/_ingame_buildings_preview.tscn /tmp/out.png 40
func _ready() -> void:
GameState.buildings.clear()
GameState.extractors.clear()
GameState.reset_formation()
GameState.add_building(GameState.BUILDING_MOTHERSHIP, Vector2(-330.0, 0.0))
GameState.add_building(GameState.BUILDING_SHIP_CRAFTER, Vector2(140.0, 0.0))
GameState.add_building(GameState.BUILDING_TRANSPORT_HUB, Vector2(480.0, 0.0))
GameState.add_building(GameState.BUILDING_SHIP_LAB, Vector2(820.0, 0.0))
var main: Node = load("res://Main.tscn").instantiate()
add_child(main)
main.get_node("AsteroidField").set_process(false)
main.get_node("EnemySpawner").set_process(false)
# Park the fleet below the pair so the camera frames both, and zoom out
# far enough to see them whole.
main.get_node("Fleet").move_to(Vector2(240.0, 260.0))
var cam: Camera2D = main.get_node("Camera2D")
cam.zoom = Vector2(0.78, 0.78)