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
|
|
|
extends SceneTree
|
|
|
|
|
|
|
|
|
|
# Headless gameplay test: run with
|
|
|
|
|
# godot --headless -s res://tests/test_planet_prompt_map_interaction.gd
|
2026-08-14 23:15:12 +02:00
|
|
|
# Opening the map while standing on a planet must suppress the shared
|
|
|
|
|
# contextual action and planet label, then restore them after closing.
|
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
|
|
|
|
|
|
|
|
var main_scene: Node
|
|
|
|
|
var fleet: Node
|
|
|
|
|
var planet_field: Node
|
|
|
|
|
var world_map: Control
|
|
|
|
|
var map_button: IconButton
|
|
|
|
|
var planet_name_label: Label
|
|
|
|
|
var enter_button: IconButton
|
|
|
|
|
var elapsed: float = 0.0
|
|
|
|
|
var stage: int = 0
|
|
|
|
|
var target_chunk: Vector2i
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _initialize() -> void:
|
|
|
|
|
var found: bool = false
|
|
|
|
|
for x in range(-15, 15):
|
|
|
|
|
for y in range(-15, 15):
|
|
|
|
|
var chunk: Vector2i = Vector2i(x, y)
|
|
|
|
|
if WorldGen.has_planet_at_chunk(chunk):
|
|
|
|
|
target_chunk = chunk
|
|
|
|
|
found = true
|
|
|
|
|
break
|
|
|
|
|
if found:
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
if not found:
|
|
|
|
|
print("FAIL: could not find any chunk with a planet to test with")
|
|
|
|
|
quit(1)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
var packed: PackedScene = load("res://Main.tscn")
|
|
|
|
|
main_scene = packed.instantiate()
|
|
|
|
|
root.add_child(main_scene)
|
|
|
|
|
fleet = main_scene.get_node("Fleet")
|
|
|
|
|
planet_field = main_scene.get_node("PlanetField")
|
|
|
|
|
world_map = main_scene.get_node("UI/WorldMap")
|
|
|
|
|
map_button = main_scene.get_node("UI/MapButton")
|
|
|
|
|
planet_name_label = main_scene.get_node("UI/PlanetNameLabel")
|
2026-08-14 23:15:12 +02:00
|
|
|
enter_button = main_scene.get_node("UI/BuildActionButton")
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
func _process(delta: float) -> bool:
|
|
|
|
|
elapsed += delta
|
|
|
|
|
match stage:
|
|
|
|
|
0:
|
|
|
|
|
main_scene.get_node("AsteroidField").set_process(false)
|
|
|
|
|
main_scene.get_node("EnemySpawner").set_process(false)
|
|
|
|
|
var vicinity_pos: Vector2 = WorldGen.chunk_origin(target_chunk) + Vector2.ONE * WorldGen.CHUNK_SIZE * 0.5
|
|
|
|
|
for ship in fleet.ships:
|
|
|
|
|
ship.position = vicinity_pos
|
|
|
|
|
fleet.move_to(vicinity_pos)
|
|
|
|
|
elapsed = 0.0
|
|
|
|
|
stage = 1
|
|
|
|
|
return false
|
|
|
|
|
1:
|
|
|
|
|
if elapsed < planet_field.check_interval + 0.1:
|
|
|
|
|
return false
|
|
|
|
|
if not planet_field.populated_chunks.has(target_chunk):
|
|
|
|
|
print("TEST_PLANET_PROMPT_MAP_INTERACTION: FAIL (planet never spawned)")
|
|
|
|
|
quit(1)
|
|
|
|
|
return true
|
|
|
|
|
var planet: Node2D = planet_field.populated_chunks[target_chunk][0]
|
|
|
|
|
for ship in fleet.ships:
|
|
|
|
|
ship.position = planet.position
|
|
|
|
|
fleet.move_to(planet.position)
|
|
|
|
|
elapsed = 0.0
|
|
|
|
|
stage = 2
|
|
|
|
|
return false
|
|
|
|
|
2:
|
|
|
|
|
if elapsed < 0.5:
|
|
|
|
|
return false
|
|
|
|
|
var prompt_shown: bool = enter_button.visible and planet_name_label.visible
|
|
|
|
|
print("prompt_shown_on_planet=%s" % prompt_shown)
|
|
|
|
|
if not prompt_shown:
|
|
|
|
|
print("TEST_PLANET_PROMPT_MAP_INTERACTION: FAIL (prompt never appeared)")
|
|
|
|
|
quit(1)
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
|
|
world_map.open_map()
|
|
|
|
|
elapsed = 0.0
|
|
|
|
|
stage = 3
|
|
|
|
|
return false
|
|
|
|
|
3:
|
|
|
|
|
if elapsed < 0.2:
|
|
|
|
|
return false
|
|
|
|
|
var prompt_suppressed: bool = not enter_button.visible and not planet_name_label.visible
|
|
|
|
|
print("prompt_suppressed_while_map_open=%s enter_visible=%s name_visible=%s" % [
|
|
|
|
|
prompt_suppressed, enter_button.visible, planet_name_label.visible
|
|
|
|
|
])
|
|
|
|
|
if not prompt_suppressed:
|
|
|
|
|
print("TEST_PLANET_PROMPT_MAP_INTERACTION: FAIL (prompt visible behind map)")
|
|
|
|
|
quit(1)
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
|
|
world_map.close_map()
|
|
|
|
|
elapsed = 0.0
|
|
|
|
|
stage = 4
|
|
|
|
|
return false
|
|
|
|
|
4:
|
|
|
|
|
if elapsed < 0.2:
|
|
|
|
|
return false
|
|
|
|
|
var prompt_restored: bool = enter_button.visible and planet_name_label.visible
|
|
|
|
|
print("prompt_restored_after_close=%s" % prompt_restored)
|
|
|
|
|
if prompt_restored:
|
|
|
|
|
print("TEST_PLANET_PROMPT_MAP_INTERACTION: PASS")
|
|
|
|
|
quit(0)
|
|
|
|
|
else:
|
|
|
|
|
print("TEST_PLANET_PROMPT_MAP_INTERACTION: FAIL (prompt did not come back)")
|
|
|
|
|
quit(1)
|
|
|
|
|
return true
|
|
|
|
|
return false
|