forked from team-sg/hero-mark-2
differentiated explosion volumes and fixed mine explosion sound not playing
This commit is contained in:
parent
8a3fc9be82
commit
7cbf467c81
4 changed files with 9 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -39,6 +39,7 @@ animations = [ {
|
|||
extents = Vector2( 24, 24 )
|
||||
|
||||
[node name="Explosion" type="Node2D"]
|
||||
pause_mode = 2
|
||||
script = ExtResource( 1 )
|
||||
blood = false
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue