fixed collapse bug

This commit is contained in:
pennyrigate 2023-09-04 05:49:28 -04:00
parent 4b7db186c7
commit 398e39ff1b
7 changed files with 103 additions and 46 deletions

View file

@ -14,24 +14,26 @@ onready var shoot_timer = $ShootTimer
onready var anims = $AnimationPlayer
onready var head_sprite = $Body/Head
#func _ready():
# for node in get_tree().get_nodes_in_group("collapse_block"):
# if node.has_method("_on_collapse"):
# connect("collapse", node, "_on_collapse")
func _on_ShootTimer_timeout():
if can_shoot:
Audio.play_sound(Audio.a_bullet_barrage,Audio.ac_boss)
for pos in positions.get_children():
var bullet = Bullet.instance()
bullet.global_position = pos.global_position
bullet.direction = Vector2.LEFT.rotated(pos.rotation)
bullet.speed = shot_speed
get_parent().add_child(bullet)
shoot_timer.wait_time = fire_rate
if can_shoot: shoot()
func shoot():
Audio.play_sound(Audio.a_bullet_barrage,Audio.ac_boss)
for pos in positions.get_children():
var bullet = Bullet.instance()
bullet.global_position = pos.global_position
bullet.direction = Vector2.LEFT.rotated(pos.rotation)
bullet.speed = shot_speed
get_parent().add_child(bullet)
shoot_timer.wait_time = fire_rate
func _play_laser_sound(play: bool):
if play:
Audio.play_sound(Audio.a_rainbow_laser,Audio.ac_boss)
else:
Audio.ac_boss.playing = false
func _play_laser_sound():
Audio.play_sound(Audio.a_rainbow_laser,Audio.ac_boss)
func die():
hp -= 1
@ -45,6 +47,7 @@ func die():
shot_speed = 70
fire_rate = 0.8
emit_signal("entered_phase", 3)
$Body/Head/Intelli.visible = true
head_sprite.texture = load("res://graphics/enemy/boss/stg2600_head_broken.png")
0:
queue_free()