41 lines
1.5 KiB
GDScript
41 lines
1.5 KiB
GDScript
extends Node2D
|
|
|
|
# Preview, not a test. A transporter mid-run between the mothership and a
|
|
# building it is supplying, so the #19 vessel can actually be looked at
|
|
# alongside the hub that stations it. Headless draws no pixels.
|
|
#
|
|
# bash tests/screenshot.sh res://tests/_transporter_preview.tscn /tmp/t.png 25 1280x720
|
|
|
|
|
|
func _ready() -> void:
|
|
GameState.buildings.clear()
|
|
GameState.extractors.clear()
|
|
GameState.transporters.clear()
|
|
GameState.rocks = 200
|
|
GameState.add_building(GameState.BUILDING_MOTHERSHIP, Vector2(-420.0, 0.0))
|
|
GameState.add_building(GameState.BUILDING_TRANSPORT_HUB, Vector2(420.0, 0.0))
|
|
|
|
# The hub already provisioned these two. Put one laden mid-leg and one on
|
|
# its way home empty so both visual states show.
|
|
var laden: Dictionary = GameState.transporters[0]
|
|
laden.state = GameState.TRANSPORTER_TO_BUILDING
|
|
laden.target_id = 2
|
|
laden.carrying = 8
|
|
laden.progress = 0.45
|
|
laden.from = Vector2(-420.0, 0.0)
|
|
laden.to = Vector2(420.0, 0.0)
|
|
var returning: Dictionary = GameState.transporters[1]
|
|
returning.state = GameState.TRANSPORTER_RETURNING
|
|
returning.progress = 0.5
|
|
returning.from = Vector2(-380.0, 150.0)
|
|
returning.to = Vector2(420.0, 150.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)
|
|
# Freeze the simulation so the vessels stay where they were placed.
|
|
GameState.set_process(false)
|
|
main.get_node("Fleet").move_to(Vector2(0.0, 260.0))
|
|
var cam: Camera2D = main.get_node("Camera2D")
|
|
cam.zoom = Vector2(0.85, 0.85)
|