Remove leftover key tile on the crate; damage keeps the player in place

The key object moved next to the spawn, so the key tile painted at cell (10,8) (on top of the crate tile) was left behind and rendered a second key. Cleared it by setting that record's source_id to -1, which is a same-length edit inside the base64 tile_map_data. Also hurt() no longer teleports to the spawn point, it only drains a heart and grants brief i-frames; only dying returns the player to the spawn.
This commit is contained in:
2026-10-07 20:56:54 +08:00
parent 19ab10de5f
commit f67bd94605
2 changed files with 7 additions and 8 deletions
+6 -7
View File
@@ -155,21 +155,20 @@ func hurt(_amount: int = 1) -> void:
health -= 1
_invulnerable = invulnerable_time
_hurt_flash = hurt_flash_time
if health <= 0:
health = 0
_die()
return
# 没死:打回出生点
global_position = _spawn_point
velocity = Vector2.ZERO
if flying:
set_flying(false)
if is_aiming:
_cancel_aim()
# 扣血不回出生点,只在原地短暂无敌
if health <= 0:
health = 0
_die()
func _die() -> void:
is_dead = true
# 只有死亡复活才回到出生点
global_position = _spawn_point
velocity = Vector2.ZERO
if flying:
set_flying(false)