An(other?) Idiotic Space Invader Question

Chunsbuns

  • Posts: 2
First off, I'm new to Stencyl. I've completed the second Crash Course and am now playing with things in the Space Invader game. What I'm trying to do is make the invaders move from side to side in formation, keeping evenly spaced. To my mind, in order to achieve this, then if any single invader hits, say, the right side of the screen then the movement for ALL invaders needs to be negated (and vice-versa for the left side of the screen, of course). So what I want is for the position of a single invader to affect the positions of all the other invaders.  Yet the block coding I used that, to me, seems to have some kind of logic, only seems to apply to a single invader, no matter that I used the For Each Actor of Type settings.

I suspect I've got something fundamentally wrong in my approach, but I can't see what it might be. Screenshot attached.

« Last Edit: October 10, 2020, 10:37:14 am by Chunsbuns »

Luyren

  • *
  • Posts: 2420
You see the pink/red "actor of type" block, inside the loop wrapper? Click and drag that to the "Self" parameter in your set speed blocks.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Chunsbuns

  • Posts: 2
You see, I didn't even know it was possible to do that. Many, many thanks. That was driving me up the bloody wall!