Artur 2026-04-15 18:00:03 +02:00
commit 671c046c3c
4 changed files with 4 additions and 5 deletions

View File

@ -3,7 +3,7 @@ extends EnemyBase
func _ready() -> void: func _ready() -> void:
super() super()
speed = 0.1 speed = 15.0
hits_remaining = 2 hits_remaining = 2
$Area2D.body_entered.connect(_on_area_2d_body_entered) $Area2D.body_entered.connect(_on_area_2d_body_entered)

View File

@ -67,11 +67,10 @@ func _process(delta: float) -> void:
pass pass
func _chase_witch() -> void: func _chase_witch() -> void:
var direction = Vector2(witch.global_position - global_position) var direction = Vector2(witch.global_position - global_position).normalized()
if direction != Vector2.ZERO: if direction != Vector2.ZERO:
last_direction = direction last_direction = direction
velocity = direction * speed velocity = direction * speed
velocity = direction * speed
if direction == Vector2.ZERO: if direction == Vector2.ZERO:
animated_sprite_2d.play("idle") animated_sprite_2d.play("idle")

View File

@ -3,7 +3,7 @@ extends EnemyBase
func _ready() -> void: func _ready() -> void:
super() super()
speed = 0.1 speed = 15.0
hits_remaining = 3 hits_remaining = 3
$Area2D.body_entered.connect(_on_area_2d_body_entered) $Area2D.body_entered.connect(_on_area_2d_body_entered)

View File

@ -6,7 +6,7 @@ extends EnemyBase
# Called every frame. 'delta' is the elapsed time since the previous frame.+ # Called every frame. 'delta' is the elapsed time since the previous frame.+
func _ready() -> void: func _ready() -> void:
super() super()
speed = 0.1 speed = 15.0
func _process(delta: float) -> void: func _process(delta: float) -> void:
if is_dying: if is_dying: