Fixed shells

This commit is contained in:
2025-12-19 16:41:16 +03:00
parent 7bdace27a8
commit 2ecc53416a
7 changed files with 48 additions and 34 deletions
@@ -21,18 +21,14 @@ func shoot(ship_velocity: Vector2) -> bool:
sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX)
_can_shoot = false
cooldown_timer.start()
_restart_particles()
front_particles.restart()
left_particles.restart()
right_particles.restart()
shell_particles.emit_particle(Transform2D(), Vector2(), Color(), Color(), 0)
return is_shot
func _restart_particles() -> void:
front_particles.restart()
left_particles.restart()
right_particles.restart()
shell_particles.restart()
func _on_animated_sprite_2d_animation_finished() -> void:
sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX)
@@ -145,9 +145,8 @@ animations = [{
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_nrbut"]
resource_local_to_scene = true
lifetime_randomness = 0.5
particle_flag_disable_z = true
inherit_velocity_ratio = 1.0
inherit_velocity_ratio = 0.5
direction = Vector3(0, 1, 0)
spread = 15.0
initial_velocity_min = 5.0
@@ -200,9 +199,9 @@ animation = &"player_idle"
z_index = 1
position = Vector2(-1, 1)
emitting = false
amount = 1
amount = 5
texture = ExtResource("6_i0ica")
lifetime = 2.0
lifetime = 3.0
one_shot = true
fixed_fps = 10
process_material = SubResource("ParticleProcessMaterial_nrbut")