Help moving a row of actors from side to side.

chrstahl89chrstahl89 Member Posts: 35
edited November -1 in Working with GS (Mac)
Hey,
I have all of my logic set up so that when my main actor hits the left wall it moves down, moves to the right until it hits that wall etc... Now I am trying to get it so I can have an entire row say of 6 actors, but I want them to all move down when one does. Any ideas?

Comments

  • chrstahl89chrstahl89 Member Posts: 35
    Replicate would work fine...but at far as I cant check collision with a replicated enemy...though I could be wrong.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I assume you're making something like space invaders?

    To "communicate" between actors, as in your example, when one actor hits a wall, have every actor move down, you need to use global game attributes.

    In that case you'll need a boolean attribute called something like "enemyHasHitWall".

    When one of the Actors hits a wall, set this global game attribute to True.

    Then have all of the Actors listen for this attribute in Rule, like this:

    When game.enemyHasHitWall = True
    [Move Down]
    [Change game.enemyHasHitWall back to False]
  • chrstahl89chrstahl89 Member Posts: 35
    Thanks, I was trying to over complicate things QQ I always have that issue in my CSC classes lol.
Sign In or Register to comment.