extends AbstractPrey @onready var sprite = get_node("AnimatedSprite2D") # Called when the node enters the scene tree for the first time. func _ready() -> void: pass # Replace with function body. # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: self.move(Vector3(randfn(0, 1), randfn(0, 1), 0)) return func move(destination: Vector3) -> void: self.position += Vector2(destination.x, destination.y) # stub func _on_rigid_body_2d_body_entered(body: Node) -> void: # TODO: collision with other entities # check if colision with player print("we collidin") if body.is_in_group("player"): handle_collision_player(body) else: self.die() # Function to handle collision logic func handle_collision_player(player): print("Collision!") self.health -= player.str if sprite: if self.health <= 0: self.die() else: sprite.play("injured")