diff --git a/assets/Player/herochar_dash_partical.png b/assets/Player/herochar_dash_partical.png new file mode 100644 index 0000000..dd675d3 Binary files /dev/null and b/assets/Player/herochar_dash_partical.png differ diff --git a/assets/Player/herochar_dash_partical.png.import b/assets/Player/herochar_dash_partical.png.import new file mode 100644 index 0000000..05b31b7 --- /dev/null +++ b/assets/Player/herochar_dash_partical.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/herochar_dash_partical.png-69b8bf33921f19c267db47aa0649ff68.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Player/herochar_dash_partical.png" +dest_files=[ "res://.import/herochar_dash_partical.png-69b8bf33921f19c267db47aa0649ff68.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/Player/herochar_dash_partical_left.png b/assets/Player/herochar_dash_partical_left.png new file mode 100644 index 0000000..2cff3fe Binary files /dev/null and b/assets/Player/herochar_dash_partical_left.png differ diff --git a/assets/Player/herochar_dash_partical_left.png.import b/assets/Player/herochar_dash_partical_left.png.import new file mode 100644 index 0000000..29a0692 --- /dev/null +++ b/assets/Player/herochar_dash_partical_left.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/herochar_dash_partical_left.png-35044098d95eb6a11a6988bd3f3a5228.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Player/herochar_dash_partical_left.png" +dest_files=[ "res://.import/herochar_dash_partical_left.png-35044098d95eb6a11a6988bd3f3a5228.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/src/Actors/DashParticles_left.tscn b/src/Actors/DashParticles_left.tscn new file mode 100644 index 0000000..f77b176 --- /dev/null +++ b/src/Actors/DashParticles_left.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://assets/Player/herochar_dash_partical_left.png" type="Texture" id=1] + +[sub_resource type="Gradient" id=1] +colors = PoolColorArray( 0, 1, 1, 0.694118, 0.862745, 0.866667, 0.901961, 0 ) + +[sub_resource type="GradientTexture" id=2] +gradient = SubResource( 1 ) + +[sub_resource type="Curve" id=3] +_data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.475 ), 0.0, 0.0, 0, 0 ] + +[sub_resource type="CurveTexture" id=4] +curve = SubResource( 3 ) + +[sub_resource type="ParticlesMaterial" id=5] +flag_disable_z = true +direction = Vector3( 0, 0, 0 ) +spread = 0.0 +gravity = Vector3( 0, 0, 0 ) +initial_velocity = 10.0 +orbit_velocity = 0.0 +orbit_velocity_random = 0.0 +scale_curve = SubResource( 4 ) +color_ramp = SubResource( 2 ) + +[node name="DashParticlesLeft" type="Particles2D"] +show_behind_parent = true +position = Vector2( -0.184715, -8.0756 ) +emitting = false +amount = 15 +lifetime = 0.8 +speed_scale = 3.0 +local_coords = false +process_material = SubResource( 5 ) +texture = ExtResource( 1 ) diff --git a/src/Actors/DashParticles_right.tscn b/src/Actors/DashParticles_right.tscn new file mode 100644 index 0000000..838cc96 --- /dev/null +++ b/src/Actors/DashParticles_right.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://assets/Player/herochar_dash_partical.png" type="Texture" id=1] + +[sub_resource type="Gradient" id=1] +colors = PoolColorArray( 0, 1, 1, 0.694118, 0.862745, 0.866667, 0.901961, 0 ) + +[sub_resource type="GradientTexture" id=2] +gradient = SubResource( 1 ) + +[sub_resource type="Curve" id=3] +_data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.475 ), 0.0, 0.0, 0, 0 ] + +[sub_resource type="CurveTexture" id=4] +curve = SubResource( 3 ) + +[sub_resource type="ParticlesMaterial" id=5] +flag_disable_z = true +direction = Vector3( 0, 0, 0 ) +spread = 0.0 +gravity = Vector3( 0, 0, 0 ) +initial_velocity = 10.0 +orbit_velocity = 0.0 +orbit_velocity_random = 0.0 +scale_curve = SubResource( 4 ) +color_ramp = SubResource( 2 ) + +[node name="DashParticlesRight" type="Particles2D"] +show_behind_parent = true +position = Vector2( -0.184715, -8.0756 ) +emitting = false +amount = 15 +lifetime = 0.8 +speed_scale = 3.0 +local_coords = false +process_material = SubResource( 5 ) +texture = ExtResource( 1 ) diff --git a/src/Actors/Player.gd b/src/Actors/Player.gd index dd9065f..d93cdf9 100644 --- a/src/Actors/Player.gd +++ b/src/Actors/Player.gd @@ -94,12 +94,10 @@ func calculate_move_velocity(direction:Vector2, is_jump_canceled:bool, delta:fl output = dash_velocity _can_dash = false _is_dashing = true # turn off gravity while dashing - $DashParticles.emitting = true - $DashParticles.position = Vector2( - position.x, - position.y - 8 - ) - $DashParticles.set_as_toplevel(true) + if dash_velocity.x < 0 : + $DashParticlesLeft.emitting = true; + else: + $DashParticlesRight.emitting = true $DashTimeout.start() return output; @@ -143,7 +141,8 @@ func die(): $AnimationPlayer.play("die") func _on_DashTimeout_timeout() -> void: - $DashParticles.emitting = false + $DashParticlesLeft.emitting = false + $DashParticlesRight.emitting = false _velocity.x = run_speed * _velocity.normalized().x; _is_dashing = false pass # Replace with function body. diff --git a/src/Actors/Player.tscn b/src/Actors/Player.tscn index 62a11bf..6b7d809 100644 --- a/src/Actors/Player.tscn +++ b/src/Actors/Player.tscn @@ -1,6 +1,8 @@ -[gd_scene load_steps=18 format=2] +[gd_scene load_steps=15 format=2] +[ext_resource path="res://src/Actors/DashParticles_right.tscn" type="PackedScene" id=1] [ext_resource path="res://src/Actors/Player.gd" type="Script" id=2] +[ext_resource path="res://src/Actors/DashParticles_left.tscn" type="PackedScene" id=3] [ext_resource path="res://assets/Items/torch_ligt_texture.png" type="Texture" id=7] [ext_resource path="res://assets/Player/herochar_spritesheet.png" type="Texture" id=8] @@ -264,32 +266,6 @@ tracks/1/keys = { "values": [ Color( 0, 0, 0, 0 ) ] } -[sub_resource type="Gradient" id=10] -offsets = PoolRealArray( 0, 0.668103, 1 ) -colors = PoolColorArray( 0.6, 0.713726, 1, 1, 0, 0.12549, 0.380392, 0.760784, 1, 1, 1, 0 ) - -[sub_resource type="GradientTexture" id=11] -gradient = SubResource( 10 ) - -[sub_resource type="Curve" id=12] -max_value = 2.0 -_data = [ Vector2( 0, 2 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.0835871 ), 0.0, 0.0, 0, 0 ] - -[sub_resource type="CurveTexture" id=13] -curve = SubResource( 12 ) - -[sub_resource type="ParticlesMaterial" id=14] -trail_size_modifier = SubResource( 13 ) -trail_color_modifier = SubResource( 11 ) -emission_shape = 2 -emission_box_extents = Vector3( 20, 4, 1 ) -flag_disable_z = true -gravity = Vector3( 0, 200, 0 ) -initial_velocity_random = 0.11 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 -linear_accel = 1.48 - [node name="Player" type="KinematicBody2D"] collision_mask = 30 script = ExtResource( 2 ) @@ -316,7 +292,7 @@ position = Vector2( 0, -8 ) texture = ExtResource( 8 ) vframes = 13 hframes = 8 -frame = 45 +frame = 48 [node name="AnimationPlayer" type="AnimationPlayer" parent="."] autoplay = "idle" @@ -344,12 +320,7 @@ __meta__ = { wait_time = 0.1 one_shot = true -[node name="DashParticles" type="Particles2D" parent="."] -position = Vector2( 0, -7 ) -emitting = false -amount = 30 -lifetime = 0.2 -one_shot = true -explosiveness = 0.5 -process_material = SubResource( 14 ) +[node name="DashParticlesLeft" parent="." instance=ExtResource( 3 )] + +[node name="DashParticlesRight" parent="." instance=ExtResource( 1 )] [connection signal="timeout" from="DashTimeout" to="." method="_on_DashTimeout_timeout"]