#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Rules regarding a range of X or Y positions.

Posts: 397Member

To clarify what I meant in the Title. So let's say we have an actor that has an attribute rule that if another actor's (we'll call this Actor B and the first actor Actor A) X position was equal to Actor A's X position ranging from X-50 to X+50. BASICALLY what I'm trying to say if I am making ANY SENSE at all is that I want a behavior that will execute if Actor B's X is equal to Actor A's X-50, X-49, X-48, -47, -46 and so on until X+50. How would I do that without 100 individual rules for each individual position? Would I have to use tables with 100 different cells? I apologize if I am not making any sense, and if need be, I can probably make a visual that can explain myself better if need be. Thanks!

Having trouble with your game? Sounds like a personal problem.

• Posts: 397Member

UPDATE: I managed to devise a way to make this work. It's kinda cheating, but it works. I was asking this because for Galastar, the game I've been working on for a while now, I may want a boss ship that dodges your shots, but I needed it to detect your bullets in some way, so I have another object that would constrain its position to the bosses position with the Y being offset by a negative amount, and if that object collides with a bullet shot by you, it will tell the boss ship to quickly move to another position.

Having trouble with your game? Sounds like a personal problem.

• Posts: 2,784Member, Sous Chef, PRO

Something like this?

When (all):
(actorA.position.X - ActorB.position.X) is greater than -50
(actorA.position.X - ActorB.position.X) is less than 50

• Posts: 397Member

@RThurman Maybe, I'll have to try it.

Having trouble with your game? Sounds like a personal problem.

• Posts: 2,784Member, Sous Chef, PRO

@ADSentertainment -- I just read your update. It seems to me that using a separate 'sensor' actor to detect when bullets are within a certain range is a great solution.