Added respawn logic ... and with it also a complete rehaul of how managing scene instances work to make it work

This commit is contained in:
Martin committed 2026-03-01 15:40:56 +01:00
1 parent 51ee5029e9
commit 6d8e8e3734
14 files changed
+194 -36

No files matched your search

@@ -103,14 +103,25 @@ func handle_damage(dmg: int, src: Node) -> void:
healthPoints -= dmg
hasiframes = true
invulnerable_cooldown_timer.start()
if healthPoints <= 0:
print("Player died. Respawn button not implemented.")
isAlive = false
if isAlive and healthPoints <= 0:
die()
func collect_resource(damnt: int) -> void:
resources += damnt
print("Resource collected! Total: ", resources)
func die() -> void:
print("Player died.")
isAlive = false
GameManager.switch_scene("respawn")
# TODO: Is this used or should it be removed? (currently unused)
func respawm() -> void:
healthPoints = maxHealth
isAlive = true
hasiframes = true
attack_cooldown_timer.start()
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.