How do I random position spawn after kill outside play area

Just started using Construct 2? Post your questions here

Post » Tue Jun 14, 2016 7:18 pm

Title is not very clear. I want an enemy to spawn only outside the playable area after another instance of that enemy has been destroyed. What is the X Y spawning coordinates needed to ensure the enemy does not spawn in the playable area? (this is for a turret survival game)
Posts: 5
Reputation: 185

Post » Tue Jun 14, 2016 8:43 pm

In your spawning condition you can use "not inside layout" condition to allow a valid spawn. It will then keep trying to place until it was outside layout. I have used this method on several projects and even with quite a few spawning objects its pretty fast with little overhead.
Otherwise you will have to determine the x,y values for your screen size and manually spawn outside these values.

You could cheat a little as well.. you could place "spawner" sprites outside your screen area and then randomly choose one of them to spawn from. I use this method when I want the enemy to randomly come from off screen but control their entry more precisely..
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
Posts: 642
Reputation: 9,864

Post » Wed Jun 15, 2016 5:41 pm

Thank you. Got it sorted.
Posts: 5
Reputation: 185

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest