spaceship/tests/_build_popup_preview.gd
Loïc Wisniewski 85814ce88c Initial commit: SpaceshipTest, a top-down space RTS in Godot 4.7.1
A fleet of neon-outlined ships explores a procedurally generated, seeded
infinite world: tap/joystick steering, pinch zoom, formation pivoting,
planet landings, an ore economy with extractors and haulers, and player
built structures (mothership, ship crafter, command centre).

All art is hand-drawn with draw_* calls rather than textures, and the
backgrounds are camera-relative shaders so they stay precise at large
world coordinates.

Includes a 35-test headless suite (tests/run_tests.sh) plus screenshot
tooling that renders real frames through Xvfb and Mesa softpipe, since
--headless has no GPU.

Excluded from version control: .godot/ (import cache, and it holds
export credentials), builds/, android/build/ and packaged APKs - all
regenerable, and ~325 MB combined.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 18:41:58 +02:00

31 lines
1 KiB
GDScript

extends Node2D
# Preview scene - NOT run by run_tests.sh (underscore prefix). Opens the
# build menu and shows a building's info popup, so the panel layout can be
# checked with real text in it. Uses the mothership-already-exists case on
# purpose: that is the longest message any option produces, so if it fits,
# the others do.
#
# bash tests/screenshot.sh res://tests/_build_popup_preview.tscn /tmp/out.png 40
const SHOW_POPUP: bool = true
func _ready() -> void:
GameState.buildings.clear()
GameState.extractors.clear()
GameState.rocks = 500
GameState.add_building(GameState.BUILDING_MOTHERSHIP, Vector2(-900.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)
var controller: Node = main.get_node("BuildController")
controller._on_build_pressed()
# Flip SHOW_POPUP to check the menu underneath
# instead of the popup that covers it.
if SHOW_POPUP:
controller._on_place_mothership()