Compose planet surfaces from profiles

This commit is contained in:
Loïc Wisniewski 2026-08-14 16:05:32 +02:00
commit 2f68515f33
19 changed files with 123 additions and 39 deletions

View file

@ -17,7 +17,8 @@ extends Node2D
@export var despawn_radius: float = 2600.0
@export var check_interval: float = 0.5
@onready var fleet: Node2D = get_node("../Fleet")
@export var fleet_path: NodePath = NodePath("../Fleet")
@onready var fleet: Node2D = get_node(fleet_path)
var rock_scene: PackedScene = preload("res://Rock.tscn")
var rocks: Array = []
@ -26,12 +27,6 @@ var rng: RandomNumberGenerator = RandomNumberGenerator.new()
func _ready() -> void:
# Gas giants have their own gas vents and must never receive ore pickups.
# This check happens before the initial population pass, unlike merely
# hiding the field later from PlanetSurfaceController.
if GameState.planet_type == "gas_giant":
set_process(false)
return
rng.randomize()
# Populate immediately rather than waiting out the first interval, so
# the surface isn't visibly empty for half a second on arrival.