frame-of-mind/src/logic-scenes/card_burner/cursor_candle.tscn

50 lines
1.8 KiB
Plaintext

[gd_scene load_steps=6 format=3 uid="uid://uc6urpgv7n1y"]
[ext_resource type="Material" uid="uid://ppu1xnd8b7td" path="res://logic-scenes/card_burner/candle.material" id="1_61aak"]
[sub_resource type="Gradient" id="Gradient_wi77g"]
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_2ph0d"]
gradient = SubResource("Gradient_wi77g")
height = 80
[sub_resource type="Gradient" id="Gradient_2ph0d"]
interpolation_mode = 2
interpolation_color_space = 1
offsets = PackedFloat32Array(0, 0.254593, 0.902887, 1)
colors = PackedColorArray(0.6, 0.443137, 0, 1, 1, 0.917647, 0.388235, 1, 0.513726, 0.772549, 0.862745, 1, 0.443137, 0.635294, 1, 1)
[sub_resource type="GDScript" id="GDScript_cfpbc"]
script/source = "extends CPUParticles2D
var noise: = FastNoiseLite.new()
var noise_position:= 0.0
var noise_offset:= Vector2.ZERO
func _process(delta: float) -> void:
var diff: Vector2 = position - noise_offset - get_viewport().get_mouse_position()
noise_position += delta * 100
noise_offset = Vector2(noise.get_noise_1d(noise_position), noise.get_noise_1d(-noise_position))*30.0
position = get_viewport().get_mouse_position() + noise_offset
rotation = lerp(rotation, clamp(-PI/3, diff.x *.05, PI/3), delta*20.0)
lifetime = max(0.01, lerp(lifetime, .25 * (1.0/(1.0+diff.length()*.1) - noise_offset.length()*.02), 0.2))
"
[node name="CursorCandle" type="CPUParticles2D"]
material = ExtResource("1_61aak")
amount = 256
texture = SubResource("GradientTexture2D_2ph0d")
lifetime = 0.25
emission_shape = 1
emission_sphere_radius = 5.0
particle_flag_align_y = true
direction = Vector2(0, -1)
spread = 0.0
gravity = Vector2(0, 800)
initial_velocity_min = 500.0
initial_velocity_max = 600.0
color_ramp = SubResource("Gradient_2ph0d")
script = SubResource("GDScript_cfpbc")