small changes in particles

main
Just Dzhi 2023-10-01 22:43:23 +04:00
parent 34e40a666e
commit 185a87a828
2 changed files with 10 additions and 5 deletions

View File

@ -5,10 +5,10 @@
[ext_resource path="res://res/shaders/colorize.tres" type="Material" id=3] [ext_resource path="res://res/shaders/colorize.tres" type="Material" id=3]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 4, 4 ) extents = Vector2( 3.5, 3.5 )
[sub_resource type="RectangleShape2D" id=2] [sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 7, 11 ) extents = Vector2( 3.5, 9 )
[sub_resource type="Animation" id=4] [sub_resource type="Animation" id=4]
resource_name = "RESET" resource_name = "RESET"
@ -48,7 +48,7 @@ tracks/0/loop_wrap = true
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/keys = { tracks/0/keys = {
"times": PoolRealArray( 0, 0.9 ), "times": PoolRealArray( 0, 2 ),
"transitions": PoolRealArray( 1, 1 ), "transitions": PoolRealArray( 1, 1 ),
"update": 1, "update": 1,
"values": [ true, false ] "values": [ true, false ]
@ -100,12 +100,15 @@ anims/damage = SubResource( 3 )
[node name="CPUParticles2D" type="CPUParticles2D" parent="."] [node name="CPUParticles2D" type="CPUParticles2D" parent="."]
position = Vector2( 10, 23 ) position = Vector2( 10, 23 )
emitting = false emitting = false
amount = 12 lifetime = 0.5
lifetime_randomness = 1.0 lifetime_randomness = 1.0
local_coords = false local_coords = false
emission_shape = 1
emission_sphere_radius = 2.0
direction = Vector2( -1, 0 ) direction = Vector2( -1, 0 )
spread = 15.0
gravity = Vector2( 0, -10 ) gravity = Vector2( 0, -10 )
initial_velocity = 8.0 initial_velocity = 8.0
color = Color( 0.458824, 0.458824, 0.458824, 1 ) color = Color( 0.458824, 0.458824, 0.458824, 0.588235 )
[connection signal="area_entered" from="EnemyCollision" to="." method="area_entered"] [connection signal="area_entered" from="EnemyCollision" to="." method="area_entered"]

View File

@ -94,6 +94,8 @@ func _process(_delta):
$Sprite.play("idle") if velocity == Vector2.ZERO else $Sprite.play("run") $Sprite.play("idle") if velocity == Vector2.ZERO else $Sprite.play("run")
if abs(velocity.x) > 10: if abs(velocity.x) > 10:
$Sprite.flip_h = true if velocity.x < 0 else false $Sprite.flip_h = true if velocity.x < 0 else false
if velocity != Vector2.ZERO:
$CPUParticles2D.emitting = true $CPUParticles2D.emitting = true
$CPUParticles2D.direction.x = 1 if velocity.x < 0 else -1 $CPUParticles2D.direction.x = 1 if velocity.x < 0 else -1
else: else: