101 lines
3.1 KiB
Plaintext
101 lines
3.1 KiB
Plaintext
[gd_scene load_steps=9 format=3 uid="uid://b2st6v25p0ley"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://kpmk21d8rlso" path="res://logic-scenes/board/particle_textures/star.png" id="1_kbpjt"]
|
|
[ext_resource type="Texture2D" uid="uid://bqilajx05t0eb" path="res://logic-scenes/board/particle_textures/void_nomotion.png" id="2_5si5k"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_kbpjt"]
|
|
script/source = "extends Node2D
|
|
|
|
@onready var particles = $GPUParticles2D
|
|
@onready var sprite = $Sprite2D
|
|
@onready var initial_position = position
|
|
@onready var parent
|
|
var noise_position = randf()
|
|
var noise: Noise = FastNoiseLite.new()
|
|
|
|
func _ready() -> void:
|
|
State.settings_changed.connect(_on_settings_updated)
|
|
|
|
parent = get_parent()
|
|
|
|
func _process(delta):
|
|
|
|
if not State.reduce_motion:
|
|
|
|
noise_position += delta * 10
|
|
|
|
var random_position = Vector2(noise.get_noise_1d(noise_position*2), noise.get_noise_1d(-noise_position))
|
|
|
|
random_position = random_position.normalized() * pow(random_position.length()*2, 3) * 5
|
|
|
|
parent.position = initial_position - random_position
|
|
|
|
parent.rotation = noise.get_noise_1d(noise_position*10) * random_position.length() * 0.01
|
|
|
|
particles.position = random_position
|
|
|
|
else: position = initial_position
|
|
|
|
func _on_settings_updated():
|
|
particles.visible = !State.reduce_motion
|
|
sprite.visible = State.reduce_motion
|
|
"
|
|
|
|
[sub_resource type="Gradient" id="Gradient_v70nd"]
|
|
interpolation_mode = 2
|
|
offsets = PackedFloat32Array(0, 0.0529197, 0.191606, 1)
|
|
colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0.491329, 1, 1, 1, 0)
|
|
|
|
[sub_resource type="GradientTexture1D" id="GradientTexture1D_xxq8p"]
|
|
gradient = SubResource("Gradient_v70nd")
|
|
|
|
[sub_resource type="Curve" id="Curve_q6cmf"]
|
|
_data = [Vector2(0, 0), 0.0, 3.16529, 0, 0, Vector2(0.241056, 0.191336), 0.132446, 0.132446, 0, 0, Vector2(1, 1), 3.94797, 0.0, 0, 0]
|
|
point_count = 3
|
|
|
|
[sub_resource type="CurveTexture" id="CurveTexture_cg0w1"]
|
|
curve = SubResource("Curve_q6cmf")
|
|
|
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_by44l"]
|
|
particle_flag_disable_z = true
|
|
emission_shape = 6
|
|
emission_ring_axis = Vector3(0, 0, 1)
|
|
emission_ring_height = 0.0
|
|
emission_ring_radius = 180.0
|
|
emission_ring_inner_radius = 185.0
|
|
emission_ring_cone_angle = 90.0
|
|
spread = 180.0
|
|
initial_velocity_min = -10.0
|
|
initial_velocity_max = 10.0
|
|
angular_velocity_min = -150.0
|
|
angular_velocity_max = -150.0
|
|
gravity = Vector3(0, 0, 0)
|
|
radial_accel_min = -20.0
|
|
radial_accel_max = -5.0
|
|
tangential_accel_min = 20.0
|
|
tangential_accel_max = 30.0
|
|
attractor_interaction_enabled = false
|
|
scale_min = 3.0
|
|
scale_max = 5.0
|
|
scale_curve = SubResource("CurveTexture_cg0w1")
|
|
color_ramp = SubResource("GradientTexture1D_xxq8p")
|
|
turbulence_noise_strength = 0.1
|
|
|
|
[node name="void_stuff" type="Node2D"]
|
|
script = SubResource("GDScript_kbpjt")
|
|
|
|
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
|
|
amount = 500
|
|
texture = ExtResource("1_kbpjt")
|
|
lifetime = 2.5
|
|
speed_scale = 1.3
|
|
explosiveness = 0.2
|
|
randomness = 0.14
|
|
local_coords = true
|
|
process_material = SubResource("ParticleProcessMaterial_by44l")
|
|
|
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
visible = false
|
|
scale = Vector2(0.4, 0.4)
|
|
texture = ExtResource("2_5si5k")
|