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:
|
func _exit_tree() -> void:
|
||||||
var explosion = SmallExplosion.instance()
|
var explosion = SmallExplosion.instance()
|
||||||
|
explosion.quiet = true
|
||||||
explosion.position = position
|
explosion.position = position
|
||||||
get_parent().add_child(explosion)
|
get_parent().add_child(explosion)
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
|
var quiet = false
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
Audio.play_sound(Audio.a_explosion,Audio.ac_die)
|
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())
|
var sprite: AnimatedSprite = get_child(randi() % get_child_count())
|
||||||
sprite.visible = true
|
sprite.visible = true
|
||||||
sprite.play()
|
sprite.play()
|
||||||
|
|
|
@ -2,7 +2,7 @@ extends "res://objects/enemy/enemy.gd"
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
$AnimatedSprite.play("explode")
|
$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():
|
func _on_animation_finished():
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|
|
@ -39,6 +39,7 @@ animations = [ {
|
||||||
extents = Vector2( 24, 24 )
|
extents = Vector2( 24, 24 )
|
||||||
|
|
||||||
[node name="Explosion" type="Node2D"]
|
[node name="Explosion" type="Node2D"]
|
||||||
|
pause_mode = 2
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
blood = false
|
blood = false
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue