Save boss and player statuses
This commit is contained in:
parent
b0c5798328
commit
6ea21b3181
9 changed files with 43 additions and 3 deletions
|
@ -50,6 +50,9 @@ func set_invincible(value):
|
|||
|
||||
func _ready():
|
||||
PlayerStats.connect("player_died", self, "_on_died")
|
||||
PlayerStats.health = SaverLoader.custom_data.health
|
||||
PlayerStats.missiles_unlocked = SaverLoader.custom_data.missiles_unlocked
|
||||
PlayerStats.missiles = SaverLoader.custom_data.missiles
|
||||
MainInstances.Player = self
|
||||
call_deferred("assign_world_camera")
|
||||
|
||||
|
@ -261,6 +264,7 @@ func _on_Hurtbox_hit(damage):
|
|||
if not invincible:
|
||||
PlayerStats.health -= damage
|
||||
blinkAnimator.play("Blink")
|
||||
SaverLoader.custom_data.health = PlayerStats.health
|
||||
|
||||
func _on_died():
|
||||
queue_free()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue