How do I prevent enemy sprites to create near player?

Get help using Construct 2

Post » Tue Aug 11, 2015 5:01 pm

I am creating enemies on a random position on the layout, but sometimes, they create near my player or right over it. How do I prevent this? I want to spawn them on the layout but a few pixels away from my player sprite.

Thanks in advance!!!
B
9
S
4
G
3
Posts: 157
Reputation: 2,300

Post » Tue Aug 11, 2015 5:47 pm

add another condition? Compare distance(x1, y1, x2, y2) ? system -> compare two values: distance(x1, y1, x2, y2) >400 etc...
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Tue Aug 11, 2015 6:01 pm

You could generate your numbers using the following logic:
Image

You must use only one of the condition at a time otherwise you will have something like this:
Image
B
15
S
6
Posts: 105
Reputation: 1,356

Post » Tue Aug 11, 2015 7:38 pm

B
21
S
8
G
6
Posts: 177
Reputation: 8,134

Post » Wed Aug 12, 2015 7:57 am

Thanks guys!!!
B
9
S
4
G
3
Posts: 157
Reputation: 2,300


Return to How do I....?

Who is online

Users browsing this forum: unicornspitfire and 65 guests