differentiated explosion volumes and fixed mine explosion sound not playing

This commit is contained in:
pennyrigate 2024-07-11 17:33:24 -04:00
parent 8a3fc9be82
commit 7cbf467c81
4 changed files with 9 additions and 2 deletions

View file

@ -17,5 +17,6 @@ func _physics_process(delta: float) -> void:
func _exit_tree() -> void:
var explosion = SmallExplosion.instance()
explosion.quiet = true
explosion.position = position
get_parent().add_child(explosion)

View file

@ -1,6 +1,11 @@
extends Node2D
var quiet = false
func _ready() -> void:
if quiet:
Audio.play_sound(Audio.a_explosion,Audio.ac_small_explosion)
else:
Audio.play_sound(Audio.a_explosion,Audio.ac_die)
var sprite: AnimatedSprite = get_child(randi() % get_child_count())
sprite.visible = true

View file

@ -2,7 +2,7 @@ extends "res://objects/enemy/enemy.gd"
func _ready():
$AnimatedSprite.play("explode")
Audio.play_sound(Audio.a_explosion,Audio.ac_die)
Audio.play_sound(Audio.a_explosion,Audio.ac_boss)
func _on_animation_finished():
queue_free()

View file

@ -39,6 +39,7 @@ animations = [ {
extents = Vector2( 24, 24 )
[node name="Explosion" type="Node2D"]
pause_mode = 2
script = ExtResource( 1 )
blood = false