23 lines
742 B
GDScript3
23 lines
742 B
GDScript3
|
|
extends Node2D
|
||
|
|
|
||
|
|
# Preview, not a test - a black hole planet as seen in space, next to a
|
||
|
|
# rocky planet for scale/contrast.
|
||
|
|
#
|
||
|
|
# bash tests/screenshot.sh res://tests/_black_hole_space_preview.tscn /tmp/black_hole.png 15 720x1280
|
||
|
|
|
||
|
|
|
||
|
|
func _ready() -> void:
|
||
|
|
GameState.extractors.clear()
|
||
|
|
GameState.buildings.clear()
|
||
|
|
|
||
|
|
_spawn("Event Zero", "black_hole", Vector2(360.0, 420.0), 12345)
|
||
|
|
_spawn("Dustworn", "rocky", Vector2(360.0, 950.0), 4242)
|
||
|
|
|
||
|
|
|
||
|
|
func _spawn(planet_name: String, definition_id: String, at: Vector2, shape_seed: int) -> void:
|
||
|
|
var planet: Node2D = load("res://Planet.tscn").instantiate()
|
||
|
|
planet.planet_name = planet_name
|
||
|
|
planet.definition_id = definition_id
|
||
|
|
planet.shape_seed = shape_seed
|
||
|
|
planet.position = at
|
||
|
|
add_child(planet)
|