hi, i’m making an adventure game and i’m trying to implement enemies. I want them to spawn at a specific area and attack the player when they get too close. I have the code for both of them and they work separately but when i put them together it doesn’t work, Please help.
You can use this extension which has this built-in block to get distance between sprites (and lots of other handy stuff )
As for your own code, the reason it’s not working is because you called the radius check function only in the “On start” block! If you put it in a “Forever” block, it will work like this!
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)