fixme: Updating void card logic
This commit is contained in:
parent
fc85ba656b
commit
ce2f6af8f8
|
|
@ -58,28 +58,23 @@ script/source = "extends AnimatedSprite2D
|
|||
|
||||
@onready var particles = $GPUParticles2D
|
||||
@onready var initial_position = position
|
||||
@export var noise_speed: float = 10
|
||||
@export var noise_power: float = 1
|
||||
var noise_position = randf()
|
||||
var noise: Noise = FastNoiseLite.new()
|
||||
var void_active:
|
||||
set(become_void):
|
||||
if not (void_active == become_void):
|
||||
if is_inside_tree():
|
||||
$GPUParticles2D.is_void = become_void
|
||||
$GPUParticles2D.emitting = become_void
|
||||
$Sprite2D.is_void = become_void
|
||||
void_active = become_void
|
||||
|
||||
@export var void_active: bool = true
|
||||
|
||||
func _process(delta):
|
||||
if void_active and not State.reduce_motion:
|
||||
noise_position += delta * 10
|
||||
noise_position += delta * noise_speed
|
||||
|
||||
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
|
||||
random_position = random_position.normalized() * pow(random_position.length()*2, noise_power) * 10
|
||||
|
||||
position = initial_position - random_position
|
||||
|
||||
rotation = noise.get_noise_1d(noise_position*10) * random_position.length() * 0.01
|
||||
rotation = noise.get_noise_1d(noise_position*7) * random_position.length() * 0.01
|
||||
|
||||
particles.position = random_position
|
||||
|
||||
|
|
@ -130,23 +125,20 @@ attractor_interaction_enabled = false
|
|||
[sub_resource type="GDScript" id="GDScript_vjwk7"]
|
||||
script/source = "extends GPUParticles2D
|
||||
|
||||
var is_void:bool = false
|
||||
|
||||
func _process(_delta):
|
||||
self.visible = !State.reduce_motion and is_void
|
||||
self.visible = !State.reduce_motion
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_tgc0b"]
|
||||
script/source = "extends Sprite2D
|
||||
|
||||
var is_void:bool = false
|
||||
|
||||
func _process(_delta):
|
||||
self.visible = State.reduce_motion and is_void
|
||||
self.visible = State.reduce_motion
|
||||
"
|
||||
|
||||
[node name="card" type="Area2D"]
|
||||
script = ExtResource("1_emip0")
|
||||
metadata/type = "card"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(-0.0713516, 0.997451)
|
||||
|
|
|
|||
Loading…
Reference in New Issue