settings, small fixes

This commit is contained in:
Daniel Kauss Serna 2026-02-15 16:17:51 +01:00
parent b12c193636
commit e08e3ebb13
174 changed files with 997 additions and 1040 deletions

View file

@ -14,22 +14,18 @@ func _on_body_entered(body: Node) -> void:
print(body)
if body is Enemy and from_player:
var bname := str(body.name)
if body.has_method("hit"):
body.hit()
onhit.emit()
body.knockback()
EventBus.debug_print.emit("Hit: " + bname)
else:
EventBus.debug_print.emit("Hitbox touched " + bname + " but it lacks 'reduce_health' method.")
body.damage()
onhit.emit()
body.knockback()
EventBus.debug_print.emit("Hit: " + bname)
if body is Player and not from_player and not hitplayer:
var bname := str(body.name)
if body.has_method("hit"):
hitplayer = true
body.hit()
onhit.emit()
EventBus.debug_print.emit("Hit: " + bname)
else:
EventBus.debug_print.emit("Hitbox touched " + bname + " but it lacks 'reduce_health' method.")
EventBus.debug_print.emit(str(body))
if body is TileMapLayer:
hitplayer = true
body.damage()
onhit.emit()
EventBus.debug_print.emit("Hit: " + bname)
EventBus.debug_print.emit(str(body))
if body is StaticBody2D:
onhit.emit()