Problem with enemies instance

0 favourites
  • 3 posts
From the Asset Store
Pixel Enemies for SHMUP consists of 38 enemy ship sprites to be used in your game.
  • 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 you

  • "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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ahhh thank you sooo much. Works like a charm :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)