Drive planets from definitions
This commit is contained in:
parent
2f68515f33
commit
02643c76c4
22 changed files with 183 additions and 82 deletions
31
GasGiantVisual.gd
Normal file
31
GasGiantVisual.gd
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
extends Node2D
|
||||
|
||||
var gas_phase: float = 0.0
|
||||
|
||||
|
||||
func configure(_shape_seed: int) -> void:
|
||||
queue_redraw()
|
||||
|
||||
|
||||
func extractor_anchor() -> Vector2:
|
||||
return Vector2(0.0, -118.0)
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
gas_phase += delta
|
||||
queue_redraw()
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
var rim := PackedVector2Array()
|
||||
for i in range(32):
|
||||
var angle := TAU * float(i) / 32.0
|
||||
rim.append(Vector2(cos(angle) * 118.0, sin(angle) * 118.0))
|
||||
NeonDraw.draw_glowing_polygon(self, rim, Color(0.4, 0.78, 1.0), 0.9)
|
||||
for row in [-62.0, -28.0, 8.0, 43.0, 73.0]:
|
||||
var band := PackedVector2Array()
|
||||
var half_width: float = sqrt(maxf(0.0, 118.0 * 118.0 - row * row))
|
||||
for i in range(15):
|
||||
var x := lerpf(-half_width, half_width, float(i) / 14.0)
|
||||
band.append(Vector2(x, row + sin(x * 0.045 + gas_phase * 1.6 + row) * 7.0))
|
||||
NeonDraw.draw_glowing_path(self, band, Color(0.85, 0.52, 1.0), 0.75, 0.65)
|
||||
Loading…
Reference in a new issue