Troubleshooting player_died signal.
This commit is contained in:
parent
afc5c68569
commit
a73fb28552
7 changed files with 48 additions and 56 deletions
16
player.gd
16
player.gd
|
|
@ -1,6 +1,6 @@
|
|||
extends Area2D
|
||||
|
||||
signal died
|
||||
|
||||
signal damage_taken
|
||||
# signal shield_damage
|
||||
# signal shield_ui
|
||||
|
|
@ -62,14 +62,14 @@ func set_shield(value: int):
|
|||
var old_value: int = shield
|
||||
shield = min(max_shield, value)
|
||||
EventBus.shield_changed.emit(max_shield, old_value, shield)
|
||||
# shield_damage.emit() # Don't need this anymore since switching to event_bus.gd
|
||||
print("Shield set to:", shield)
|
||||
if shield <= 0:
|
||||
set_process(false)
|
||||
$Ship.hide()
|
||||
$Explosion.show()
|
||||
$Explosion/AnimationPlayer.play("explosion-one-shot")
|
||||
await $Explosion/AnimationPlayer.animation_finished
|
||||
died.emit()
|
||||
set_process(false)
|
||||
$Ship.hide()
|
||||
$Explosion.show()
|
||||
$Explosion/AnimationPlayer.play("explosion-one-shot")
|
||||
await $Explosion/AnimationPlayer.animation_finished
|
||||
EventBus.player_died.emit()
|
||||
|
||||
func _on_gun_cooldown_timeout() -> void:
|
||||
can_shoot = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue