Added projectiles timeouts. Added GatlingWeapon animation
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
extends AbstractWeapon
|
||||
|
||||
|
||||
@export var reloader : GatlingReloader
|
||||
|
||||
|
||||
@onready var sprite : AnimatedSprite2D = $AnimatedSprite2D
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
reloader.process(delta)
|
||||
@onready var particles : GPUParticles2D = $GPUParticles2D
|
||||
|
||||
|
||||
func set_belonging(belonging: Belonging) -> void:
|
||||
@@ -18,9 +12,14 @@ func set_belonging(belonging: Belonging) -> void:
|
||||
|
||||
|
||||
func shoot(ship_velocity: Vector2) -> bool:
|
||||
_can_shoot = reloader.can_shoot()
|
||||
var is_shot := super.shoot(ship_velocity)
|
||||
if is_shot:
|
||||
reloader.shoot()
|
||||
_can_shoot = false
|
||||
sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX)
|
||||
particles.restart()
|
||||
|
||||
return is_shot
|
||||
|
||||
|
||||
func _on_animated_sprite_2d_animation_finished() -> void:
|
||||
_can_shoot = true
|
||||
|
||||
Reference in New Issue
Block a user