Added minelayer shot and tick sounds
This commit is contained in:
@@ -9,7 +9,7 @@ enum SpriteState {
|
||||
}
|
||||
|
||||
|
||||
const OFF_TIMES = [
|
||||
const OFF_TIMES : Array[float] = [
|
||||
1.0, 1.0, 0.5, 0.25, 0.05, 0.05, 0.05, 0.05, 0.05,
|
||||
]
|
||||
const ON_TIME = 0.05
|
||||
@@ -74,8 +74,13 @@ func _on_sprite_on_timer_timeout() -> void:
|
||||
_try_to_damage_by_blast()
|
||||
_process_hit_for_projectile(null)
|
||||
else:
|
||||
var delay_time := OFF_TIMES[_current_off_time_index]
|
||||
var stream : AudioStream = SoundManager.sfx_weapon_minelayer_tick_low if delay_time > 0.1 \
|
||||
else SoundManager.sfx_weapon_minelayer_tick_high
|
||||
SoundManager.play_sfx_stream(stream, global_position)
|
||||
|
||||
_current_sprite_state = SpriteState.OFF
|
||||
sprite_off_timer.start(OFF_TIMES[_current_off_time_index])
|
||||
sprite_off_timer.start(delay_time)
|
||||
|
||||
|
||||
func _on_sprite_off_timer_timeout() -> void:
|
||||
|
||||
@@ -12,6 +12,7 @@ func shoot(ship_velocity: Vector2) -> bool:
|
||||
var is_shot := super.shoot(ship_velocity)
|
||||
if is_shot:
|
||||
_can_shoot = false
|
||||
SoundManager.play_sfx_stream(SoundManager.sfx_weapon_minelayer_shot, global_position)
|
||||
sprite.play(SHOT_ANIMATION)
|
||||
|
||||
return is_shot
|
||||
|
||||
@@ -74,3 +74,6 @@ projectile_scene = ExtResource("3_nkog1")
|
||||
[node name="AnimatedSprite2D" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_nkog1")
|
||||
animation = &"shot"
|
||||
|
||||
[node name="Muzzle" parent="." index="1"]
|
||||
position = Vector2(-9, 0)
|
||||
|
||||
@@ -72,5 +72,9 @@ script = ExtResource("2_mvhh7")
|
||||
projectile_scene = ExtResource("3_u0als")
|
||||
|
||||
[node name="AnimatedSprite2D" parent="." index="0"]
|
||||
position = Vector2(2, 0)
|
||||
sprite_frames = SubResource("SpriteFrames_u0als")
|
||||
animation = &"shot"
|
||||
|
||||
[node name="Muzzle" parent="." index="1"]
|
||||
position = Vector2(9, 0)
|
||||
|
||||
@@ -28,6 +28,9 @@ const MUSIC_BUS = "Music"
|
||||
@export_subgroup("Weapon", "sfx_weapon")
|
||||
@export var sfx_weapon_gatling_shot : AudioStream
|
||||
@export var sfx_weapon_cannon_shot : AudioStream
|
||||
@export var sfx_weapon_minelayer_shot : AudioStream
|
||||
@export var sfx_weapon_minelayer_tick_high : AudioStream
|
||||
@export var sfx_weapon_minelayer_tick_low : AudioStream
|
||||
@export var sfx_weapon_plasma_shot : AudioStream
|
||||
@export var sfx_weapon_railgun_shot : AudioStream
|
||||
@export var sfx_weapon_sharapnel_shot : AudioStream
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://bc0np3ldfspq4"]
|
||||
[gd_scene load_steps=14 format=3 uid="uid://bc0np3ldfspq4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cx5qcukr66whc" path="res://game/managers/sound_manager.gd" id="1_cg0sy"]
|
||||
[ext_resource type="AudioStream" uid="uid://bqcqigmj23ub5" path="res://sound/ui/ui_accept.wav" id="2_agyxs"]
|
||||
@@ -10,6 +10,9 @@
|
||||
[ext_resource type="AudioStream" uid="uid://b4l3ksw7gh8u0" path="res://sound/sfx/weapon/plasma_shot.wav" id="8_6ll5c"]
|
||||
[ext_resource type="AudioStream" uid="uid://bqo2n7jytda3r" path="res://sound/sfx/weapon/shrapnel_shot.wav" id="8_22ptj"]
|
||||
[ext_resource type="AudioStream" uid="uid://cflrm2y3yp371" path="res://sound/sfx/weapon/railgun_shot.wav" id="8_ab171"]
|
||||
[ext_resource type="AudioStream" uid="uid://dmp6cimf8uy0x" path="res://sound/sfx/weapon/minelayer_shot.wav" id="8_q7cyi"]
|
||||
[ext_resource type="AudioStream" uid="uid://hv28c6ivh4fx" path="res://sound/sfx/weapon/minelayer_tick_high.wav" id="9_wyfta"]
|
||||
[ext_resource type="AudioStream" uid="uid://dew2108vd3e1d" path="res://sound/sfx/weapon/minelayer_tick_low.wav" id="10_814q3"]
|
||||
|
||||
[node name="SoundManager" type="Node"]
|
||||
script = ExtResource("1_cg0sy")
|
||||
@@ -25,6 +28,9 @@ ui_stream_next = ExtResource("4_fpnh3")
|
||||
ui_stream_previous = ExtResource("5_22ptj")
|
||||
sfx_weapon_gatling_shot = ExtResource("6_0i6kl")
|
||||
sfx_weapon_cannon_shot = ExtResource("7_fpnh3")
|
||||
sfx_weapon_minelayer_shot = ExtResource("8_q7cyi")
|
||||
sfx_weapon_minelayer_tick_high = ExtResource("9_wyfta")
|
||||
sfx_weapon_minelayer_tick_low = ExtResource("10_814q3")
|
||||
sfx_weapon_plasma_shot = ExtResource("8_6ll5c")
|
||||
sfx_weapon_railgun_shot = ExtResource("8_ab171")
|
||||
sfx_weapon_sharapnel_shot = ExtResource("8_22ptj")
|
||||
|
||||
Reference in New Issue
Block a user