How can I make something like this?
I have enemy and player.
If distance between player and enemy is less or equal 100, then enemy starts moving towards player (I know how to make enemy move towards player).
Develop games in your browser. Powerful, performant & highly capable.
You can use distance(player.x,player.y,enemy.x,enemy.y) to get the distance between your player and the enemy.