The idea is having an enemy AI patrol the area walking, and then run towards the player once detected. The game ends when the enemy touches the player. Right now, the enemy running speed is greater than the player speed.
The issue (in the video) is that the enemy will slow down once it gets close (but not reach) the player. So if the player stays in movement, they won’t be caught.