Files
GMTK25/ennemy/armored_ennemy.gd
Minimata 2d44a2da05
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 6s
Create tag and build when new code gets to main / Export (push) Successful in 2m26s
feat: final cutscene and full game loop
2025-08-03 11:25:21 +02:00

28 lines
629 B
GDScript

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("idle")
func play_anim_idle():
animated_sprite.play("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