Reworked weapons and projectiles

This commit is contained in:
2025-12-20 18:35:27 +03:00
parent 2ecc53416a
commit 8227e8bcf3
312 changed files with 2466 additions and 1376 deletions
@@ -0,0 +1,27 @@
class_name AbstractGatlingWeapon
extends AbstractWeapon
@onready var sprite : AnimatedSprite2D = $AnimatedSprite2D
@onready var shot_particles : GPUParticles2D = $ShotParticles
@onready var shell_particles : GPUParticles2D = $ShellParticles
func _ready() -> void:
sprite.play(IDLE_ANIMATION)
func shoot(ship_velocity: Vector2) -> bool:
var is_shot := super.shoot(ship_velocity)
if is_shot:
_can_shoot = false
sprite.play(SHOT_ANIMATION)
shot_particles.restart()
shell_particles.emit_particle(Transform2D(), Vector2(), Color(), Color(), 0)
return is_shot
func _on_animated_sprite_2d_animation_finished() -> void:
_can_shoot = true
sprite.play(IDLE_ANIMATION)