diff --git a/items/MultiTunnelMissleLauncher.tres b/items/MultiTunnelMissleLauncher.tres index 76e2df8..33d437c 100644 --- a/items/MultiTunnelMissleLauncher.tres +++ b/items/MultiTunnelMissleLauncher.tres @@ -14,7 +14,7 @@ script = ExtResource( 1 ) CurrentItemType = 0 ItemID = "SYC-310" Name = "Multi - Tunnel Missle Launcher" -Description = "Multi Tunnel Missle Launcher(ATTACK = 20 x 2)" +Description = "Multi Tunnel Missle Launcher(ATTACK = 10 x 2)" Price = 50 Stackable = false MaxStackableCount = 0 diff --git a/projectiles/Missle.cs b/projectiles/Missle.cs index 187c192..d1f3a59 100644 --- a/projectiles/Missle.cs +++ b/projectiles/Missle.cs @@ -14,6 +14,16 @@ public override void _Ready() base._Ready(); } + public override void Explode() + { + base.Explode(); + + AgentExplosionParticle explosion = (AgentExplosionParticle)GetNode("AgentExplosionParticle"); + explosion.SetTrigger(true); + + AudioManager audioManager = (AudioManager)GetNode("/root/AUDIOMANAGER"); + audioManager.playSoundEffect(MusicHitClip); + } protected override void ComputeDamage() { diff --git a/projectiles/Missle.tscn b/projectiles/Missle.tscn index cf97db7..b44bd08 100644 --- a/projectiles/Missle.tscn +++ b/projectiles/Missle.tscn @@ -4,8 +4,8 @@ [ext_resource path="res://assets/allSprites_retina_rotated.png" type="Texture" id=2] [ext_resource path="res://assets/spr_smoke_strip24.png" type="Texture" id=3] [ext_resource path="res://projectiles/Missle.cs" type="Script" id=4] -[ext_resource path="res://effects/Trail.tscn" type="PackedScene" id=5] [ext_resource path="res://effects/BoosterTrail.tscn" type="PackedScene" id=6] +[ext_resource path="res://effects/AgentExplosionParticle.tscn" type="PackedScene" id=7] [sub_resource type="CanvasItemMaterial" id=1] resource_local_to_scene = true @@ -34,8 +34,8 @@ blend_mode = 1 [node name="Missle" instance=ExtResource( 1 )] script = ExtResource( 4 ) -Speed = 2000 -Damage = 1 +Speed = 1500 +Damage = 5 Lifetime = 20.0 [node name="Sprite" parent="." index="0"] @@ -45,13 +45,10 @@ texture = ExtResource( 2 ) region_enabled = true region_rect = Rect2( 361, 39, 36, 24 ) -[node name="Explosion" parent="." index="2"] -scale = Vector2( 5, 5 ) - -[node name="ProjectileArea2D" parent="." index="3"] +[node name="ProjectileArea2D" parent="." index="2"] visible = false -[node name="Trail" type="Particles2D" parent="." index="4"] +[node name="ParticleTrail" type="Particles2D" parent="." index="3"] self_modulate = Color( 6, 3, 0, 1 ) show_behind_parent = true material = SubResource( 1 ) @@ -62,10 +59,11 @@ local_coords = false process_material = SubResource( 4 ) texture = ExtResource( 3 ) -[node name="Trail2" parent="." index="5" instance=ExtResource( 5 )] -_length = 20 +[node name="AgentExplosionParticle" parent="." index="4" instance=ExtResource( 7 )] -[node name="BoosterTrail" parent="." index="6" instance=ExtResource( 6 )] +[node name="BoosterTrail" parent="." index="5" instance=ExtResource( 6 )] visible = false material = SubResource( 5 ) rotation = 3.14159 + +[connection signal="EffectCompleteSignal" from="AgentExplosionParticle" to="." method="_OnExplosionAnimationFinished"] diff --git a/projectiles/MultiTunnelMissle.tscn b/projectiles/MultiTunnelMissle.tscn index a34e12b..261d6b7 100644 --- a/projectiles/MultiTunnelMissle.tscn +++ b/projectiles/MultiTunnelMissle.tscn @@ -1,45 +1,42 @@ -[gd_scene load_steps=13 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://projectiles/Projectile.tscn" type="PackedScene" id=1] [ext_resource path="res://assets/allSprites_retina_rotated.png" type="Texture" id=2] [ext_resource path="res://assets/spr_smoke_strip24.png" type="Texture" id=3] [ext_resource path="res://projectiles/MultiTunnelMissle.cs" type="Script" id=4] -[ext_resource path="res://effects/Trail.tscn" type="PackedScene" id=5] [ext_resource path="res://effects/BoosterTrail.tscn" type="PackedScene" id=6] +[ext_resource path="res://effects/AgentExplosionParticle.tscn" type="PackedScene" id=7] -[sub_resource type="RectangleShape2D" id=6] +[sub_resource type="RectangleShape2D" id=1] extents = Vector2( 13.9327, 8.17027 ) -[sub_resource type="CanvasItemMaterial" id=1] +[sub_resource type="CanvasItemMaterial" id=2] resource_local_to_scene = true particles_animation = true particles_anim_h_frames = 24 particles_anim_v_frames = 1 particles_anim_loop = false -[sub_resource type="Curve" id=2] +[sub_resource type="Curve" id=3] _data = [ Vector2( 0, 0 ), 0.0, 0.201237, 0, 0, Vector2( 1, 1 ), -0.0628936, 0.0, 0, 0 ] -[sub_resource type="CurveTexture" id=3] -curve = SubResource( 2 ) +[sub_resource type="CurveTexture" id=4] +curve = SubResource( 3 ) -[sub_resource type="ParticlesMaterial" id=4] +[sub_resource type="ParticlesMaterial" id=5] flag_disable_z = true gravity = Vector3( 0, 0, 0 ) orbit_velocity = 0.0 orbit_velocity_random = 0.0 scale = 2.0 -scale_curve = SubResource( 3 ) +scale_curve = SubResource( 4 ) anim_speed = 1.0 -[sub_resource type="CanvasItemMaterial" id=5] -blend_mode = 1 - [node name="MultiTunnelMissle" instance=ExtResource( 1 )] cast_to = Vector2( 20, 0 ) script = ExtResource( 4 ) Speed = 2000 -Damage = 20 +Damage = 10 Lifetime = 100.0 SteerForce = 100.0 @@ -49,31 +46,29 @@ texture = ExtResource( 2 ) region_enabled = true region_rect = Rect2( 480, 40, 36, 23 ) -[node name="Explosion" parent="." index="2"] -scale = Vector2( 5, 5 ) - -[node name="ProjectileArea2D" parent="." index="3"] +[node name="ProjectileArea2D" parent="." index="2"] visible = false [node name="CollisionShape2D" parent="ProjectileArea2D" index="0"] visible = false -shape = SubResource( 6 ) +shape = SubResource( 1 ) -[node name="Trail" type="Particles2D" parent="." index="4"] +[node name="ParticleTrail" type="Particles2D" parent="." index="3"] self_modulate = Color( 6, 3, 0, 1 ) show_behind_parent = true -material = SubResource( 1 ) +material = SubResource( 2 ) position = Vector2( -40, 0 ) amount = 32 lifetime = 0.4 local_coords = false -process_material = SubResource( 4 ) +process_material = SubResource( 5 ) texture = ExtResource( 3 ) -[node name="Trail2" parent="." index="5" instance=ExtResource( 5 )] -_length = 20 +[node name="AgentExplosionParticle" parent="." index="4" instance=ExtResource( 7 )] +rotation = 3.14159 -[node name="BoosterTrail" parent="." index="6" instance=ExtResource( 6 )] +[node name="BoosterTrail" parent="." index="5" instance=ExtResource( 6 )] visible = false -material = SubResource( 5 ) rotation = 3.14159 + +[connection signal="EffectCompleteSignal" from="AgentExplosionParticle" to="." method="_OnExplosionAnimationFinished"] diff --git a/projectiles/Projectile.cs b/projectiles/Projectile.cs index b04a372..3a59203 100644 --- a/projectiles/Projectile.cs +++ b/projectiles/Projectile.cs @@ -32,7 +32,7 @@ public class Projectile : RayCast2D // https://gamesounds.xyz/?dir=FXHome private AudioStream _musicClip = (AudioStream)GD.Load("res://assets/sounds/Future Weapons 2 - Energy Gun - shot_single_2.wav"); - protected AudioStream MusicHitClip = (AudioStream)GD.Load("res://assets/sounds/Bullet Impact 22.wav"); + protected AudioStream MusicHitClip = (AudioStream)GD.Load("res://assets/sounds/Bullet Impact 22.wav"); protected bool IsProjectileStart = false; @@ -106,9 +106,6 @@ public override void _PhysicsProcess(float delta) ComputeDamage(); Explode(); - - AudioManager audioManager = (AudioManager)GetNode("/root/AUDIOMANAGER"); - audioManager.playSoundEffect(MusicHitClip); } GlobalPosition += Transform.x * Speed * delta; @@ -127,13 +124,10 @@ public virtual void Explode() IsProjectileStart = false; Enabled = IsProjectileStart; - Velocity = new Vector2(); + Velocity = Vector2.Zero; + Sprite sprite = (Sprite)GetNode("Sprite"); sprite.Hide(); - AnimatedSprite explosion = (AnimatedSprite)GetNode("Explosion"); - explosion.Show(); - explosion.Play("smoke"); - } private void _onLifetimeTimeout() @@ -141,7 +135,7 @@ private void _onLifetimeTimeout() Explode(); } - private void _OnExplosionAnimationFinished() + protected void _OnExplosionAnimationFinished() { QueueFree(); } diff --git a/projectiles/Projectile.tscn b/projectiles/Projectile.tscn index 7e6cf10..cbaabe1 100644 --- a/projectiles/Projectile.tscn +++ b/projectiles/Projectile.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://projectiles/Projectile.cs" type="Script" id=1] -[ext_resource path="res://effects/Explosion.tscn" type="PackedScene" id=2] [ext_resource path="res://projectiles/ProjectileArea2D.cs" type="Script" id=3] [node name="Projectile" type="RayCast2D"] @@ -15,15 +14,10 @@ region_rect = Rect2( 1098, 442, 27, 17 ) [node name="Lifetime" type="Timer" parent="."] wait_time = 10.0 -[node name="Explosion" parent="." instance=ExtResource( 2 )] -visible = false -scale = Vector2( 0.5, 0.5 ) - [node name="ProjectileArea2D" type="Area2D" parent="."] script = ExtResource( 3 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="ProjectileArea2D"] [connection signal="timeout" from="Lifetime" to="." method="_onLifetimeTimeout"] -[connection signal="animation_finished" from="Explosion" to="." method="_OnExplosionAnimationFinished"] [connection signal="area_entered" from="ProjectileArea2D" to="ProjectileArea2D" method="_onProjectileAreaEntered"] diff --git a/projectiles/RifileBullet.cs b/projectiles/RifileBullet.cs index 8d61ce0..d6a0bc5 100644 --- a/projectiles/RifileBullet.cs +++ b/projectiles/RifileBullet.cs @@ -4,10 +4,8 @@ public class RifileBullet : Projectile { - private Trail trail; public override void _Ready() { - trail = (Trail)GetNode("Trail"); base._Ready(); } @@ -18,7 +16,14 @@ public override void _PhysicsProcess(float delta) public override void Explode() { - trail.Stop(); base.Explode(); + + ((Trail)GetNode("LineTrail")).Stop(); + + Sprite sprite = (Sprite)GetNode("Sprite"); + sprite.Hide(); + AnimatedSprite explosion = (AnimatedSprite)GetNode("Explosion"); + explosion.Show(); + explosion.Play("smoke"); } } diff --git a/projectiles/RifileBullet.tscn b/projectiles/RifileBullet.tscn index ff0185e..8d40f90 100644 --- a/projectiles/RifileBullet.tscn +++ b/projectiles/RifileBullet.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://projectiles/Projectile.tscn" type="PackedScene" id=1] [ext_resource path="res://assets/allSprites_retina_rotated.png" type="Texture" id=2] [ext_resource path="res://projectiles/RifileBullet.cs" type="Script" id=3] [ext_resource path="res://effects/Trail.tscn" type="PackedScene" id=4] [ext_resource path="res://projectiles/Particle2DProjectile.tscn" type="PackedScene" id=5] +[ext_resource path="res://effects/Explosion.tscn" type="PackedScene" id=6] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 20.125, 7.75 ) @@ -58,10 +59,7 @@ texture = ExtResource( 2 ) region_enabled = true region_rect = Rect2( 653, 41, 30, 24 ) -[node name="Explosion" parent="." index="2"] -scale = Vector2( 0.3, 0.3 ) - -[node name="ProjectileArea2D" parent="." index="3"] +[node name="ProjectileArea2D" parent="." index="2"] visible = false collision_layer = 4 collision_mask = 4 @@ -69,11 +67,17 @@ collision_mask = 4 [node name="CollisionShape2D" parent="ProjectileArea2D" index="0"] shape = SubResource( 1 ) -[node name="Particle2DProjectile" parent="." index="4" instance=ExtResource( 5 )] +[node name="ParticleTrail" parent="." index="3" instance=ExtResource( 5 )] material = SubResource( 2 ) process_material = SubResource( 7 ) texture = null -[node name="Trail" parent="." index="5" instance=ExtResource( 4 )] +[node name="Explosion" parent="." index="4" instance=ExtResource( 6 )] +visible = false +scale = Vector2( 0.75, 0.75 ) + +[node name="LineTrail" parent="." index="5" instance=ExtResource( 4 )] _length = 5 _gradientColor = SubResource( 8 ) + +[connection signal="animation_finished" from="Explosion" to="." method="_OnExplosionAnimationFinished"]