feat: integrated some assets and made a hitbox and damage reaction system
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 5s
Create tag and build when new code gets to main / Export (push) Successful in 2m5s

This commit is contained in:
2025-08-01 17:17:00 +02:00
parent 44f083fbce
commit 6e017197f6
26 changed files with 484 additions and 449 deletions

View File

@ -1,6 +1,11 @@
extends CharacterBody2D
@onready var animated_sprite: AnimatedSprite2D = $AnimatedSprite2D
@onready var time_to_finish_hit: Timer = $TimeToFinishHit
@onready var hitbox: Area2D = $Hitbox
func _ready() -> void:
hitbox.monitoring = false
func play_anim_run():
animated_sprite.play("run")
@ -10,3 +15,13 @@ func play_anim_idle():
func hit():
animated_sprite.play("hit")
time_to_finish_hit.start()
hitbox.monitoring = true
func _on_trigger_hit_body_entered(body: Node2D) -> void:
if body.name == "Player":
hit()
func _on_time_to_finish_hit_timeout() -> void:
play_anim_idle()
hitbox.monitoring = false