How do I spawn objects at certain points

Get help using Construct 2

Post » Sun Oct 08, 2017 10:02 am

I was wondering how you could spawn objects in a certain way: so i want objects to spawn randomly all over the layout except a circle that follows my player so i avoid them spawning right over the player.
|...... O ....|
|_________| (ignore the dots)

so i tried "drawing" what i meant. i want object to spawn randomly in the rectangle (i know how to do that already) except the circle. So everywhere in the rectange but not the circle. the circle will be moving (following the player)
Thanks in advance!
Posts: 60
Reputation: 701

Post » Sun Oct 08, 2017 10:28 am

This may not be the most efficient method, but it works


Note: When using While like this you need to be aware of the danger of creating an infinite loop. If there is even a slight possibility that the correct x and y coordinates will never be found (say the safeRadius is too big), you should implement some way to terminate the loop. For example a counter - exit the loop if the counter reaches 100.

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
Posts: 2,373
Reputation: 84,373

Return to How do I....?

Who is online

Users browsing this forum: marmis and 4 guests