Randoloot/scripts/game/space_level_background.gd
2026-10-10 21:21:58 +02:00

18 lines
653 B
GDScript

extends Node2D
const WORLD_SIZE := Vector2(5200.0, 3600.0)
func _draw() -> void:
var half_size := WORLD_SIZE * 0.5
draw_rect(Rect2(-half_size, WORLD_SIZE), Color("050b18"), true)
var rng := RandomNumberGenerator.new()
rng.seed = GameState.system_seed
for index in 420:
var point := Vector2(
rng.randf_range(-half_size.x + 35.0, half_size.x - 35.0),
rng.randf_range(-half_size.y + 35.0, half_size.y - 35.0)
)
var radius := rng.randf_range(0.7, 2.0)
var color := Color(0.58, 0.76, 1.0, rng.randf_range(0.2, 0.72))
draw_circle(point, radius, color)
draw_rect(Rect2(-half_size, WORLD_SIZE), Color(0.12, 0.52, 0.68, 0.48), false, 3.0)