Problem with enemies instance

Get help using Construct 2

Post » Thu Sep 27, 2012 12:16 pm

Hello guys,

I have little problem. I have a small game with group of 20 same enemies (instances) they all move in the same direction. And now I want that when some of them hits the wall they change direction.

So I have something like

enemy1. on collision with wall {

enemy1. reverse 8direction
}

It works perfectly the only problem is that I want to change direction for all those instances immediately once whatever instance collides with the wall. But right now it acts separately. So for example instance 1 change direction when it hits the wall. Instance2 changes direction when it hits the wall. What I want is:

when whatever instance hits the wall, change direction for all of them immediately.

What is the solusion? Do I need to use foreach loop or something? thank youMichal112012-09-27 12:16:51
B
8
S
2
Posts: 45
Reputation: 1,168

Post » Thu Sep 27, 2012 12:33 pm

"when whatever instance hits the wall, change direction for all of them immediately"

Have you try to use " Pick all instance"

when enemy1 hit the wall

system pick all instance "enemy1" > go to right for example

B
50
S
12
G
7
Posts: 259
Reputation: 10,371

Post » Thu Sep 27, 2012 12:45 pm

ahhh thank you sooo much. Works like a charm :)
B
8
S
2
Posts: 45
Reputation: 1,168


Return to How do I....?

Who is online

Users browsing this forum: farfetchd83, mjj1990, Yahoo [Bot] and 4 guests