forked from team-sg/hero-mark-2
arrow dust particles UwU
This commit is contained in:
parent
863961cc92
commit
8212e44044
4 changed files with 82 additions and 1 deletions
|
@ -15,6 +15,15 @@ func _physics_process(delta):
|
|||
if Game.get_sector(global_position + cull_edge) != initial_sector:
|
||||
queue_free()
|
||||
|
||||
func _exit_tree():
|
||||
# make sure particles node sticks around until particles decay
|
||||
var particles = $DustParticles
|
||||
remove_child(particles)
|
||||
particles.global_position = global_position
|
||||
particles.emitting = false
|
||||
get_parent().add_child(particles)
|
||||
particles.get_node("DeathTimer").start()
|
||||
|
||||
#Wall Collision
|
||||
func _on_Area2D_body_entered(body):
|
||||
if body is TileMap or body is StaticBody2D:
|
||||
|
|
|
@ -1,14 +1,37 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://scripts/1px_border.gdshader" type="Shader" id=1]
|
||||
[ext_resource path="res://graphics/player/arrow.png" type="Texture" id=2]
|
||||
[ext_resource path="res://objects/player/arrow_projectile.gd" type="Script" id=3]
|
||||
[ext_resource path="res://graphics/particles/dust.png" type="Texture" id=4]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=1]
|
||||
shader = ExtResource( 1 )
|
||||
shader_param/border_color = Color( 0, 0, 0, 1 )
|
||||
shader_param/border_corners = true
|
||||
|
||||
[sub_resource type="Curve" id=3]
|
||||
_data = [ Vector2( 0, 1 ), 0.0, -0.139481, 0, 0, Vector2( 1, 0 ), -2.82064, 0.0, 0, 0 ]
|
||||
|
||||
[sub_resource type="CurveTexture" id=4]
|
||||
width = 32
|
||||
curve = SubResource( 3 )
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=5]
|
||||
flag_disable_z = true
|
||||
spread = 180.0
|
||||
gravity = Vector3( 0, 0, 0 )
|
||||
initial_velocity = 8.0
|
||||
initial_velocity_random = 0.18
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
damping = 1.0
|
||||
angle = 720.0
|
||||
angle_random = 1.0
|
||||
scale = 0.25
|
||||
scale_random = 0.25
|
||||
scale_curve = SubResource( 4 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 5.5, 3.5 )
|
||||
|
||||
|
@ -20,10 +43,24 @@ material = SubResource( 1 )
|
|||
z_index = -1
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="DustParticles" type="Particles2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2( -4, 0 )
|
||||
z_index = -1
|
||||
amount = 24
|
||||
local_coords = false
|
||||
process_material = SubResource( 5 )
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
[node name="DeathTimer" type="Timer" parent="DustParticles"]
|
||||
one_shot = true
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="." groups=["arrow"]]
|
||||
visible = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2( -0.5, -0.5 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[connection signal="timeout" from="DustParticles/DeathTimer" to="DustParticles" method="queue_free"]
|
||||
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue