How to make enemies spawn and approach player in radius

Basic follow system


The follow code should be on a game update block so the sprites are constantly checking if the player is near.


More complex follow

I like to use the distance block on the enemy sprite follow speed so it’s always close to the player


and also some collision so the snakes don’t overlap each other
The 2 number parameters control the velocity and the acceleration of the enemy sprites when they overlap with each other (how fast they collide away from each other)

3 Likes