Rookie question RE: enemy sprite movement

I apologize for starting a new thread, I tried to look it up and test it myself but I’m still doing something wrong…

So here is the issue. I’m trying to make an enemy sprite that will move back and forth (x axis only) between two boundaries (A and B), but without colliding with or interacting with other solid objects in between A and B.

I thought the solution would be to make the sprite non-solid, enable collisions, and set the sprite to flip/toggle when interacting with objects A and B, but for some reason my stupid sprite is ignoring the toggle command completely and passing right through the A and B objects.

What am I doing wrong?

ADDITIONAL: I have tried changing the movement to x instead of forward, I’ve tried setting movement to both once and always, I’ve tried a number of different combinations of commands, and yet my sprite is still ignoring the basic collision command.

Tried setting it as a polygon, a square, a circle… nothing I’m trying is working. The sprite acts like it doesn’t even acknowledge the collision at all.

Please forgive my newbiness.

MORE ADDITIONAL:

1

2

I tried making it solid, but then it interacts with everything, and I don’t want it to interact with everything. I’ve tried connecting the collision to a negative numbered velocity instead of the flip, I’ve tried plugging the flip into the original velocity, I’ve tried several different combinations.

And still. The sprite is completely ignoring the “Rock” that is supposed to trigger the collision command. He just walks right through it as if it doesn’t exist.

To uh… help further explain my issue…

Steve and Dan work in an office. Dan wants to refill his coffee. Steve needs to make copies of important documents.

They are both solid objects in a 2 dimensional world, sharing the same x-axis, so…

When they collide, they’re both triggering each other’s collision commands, and neither one is making it to their destination.

I want both of them to be able to pass through each other, but also to stop at their destinations. So I try to make one of them “non solid”, so as to not get in the other one’s way. I make Dan non solid. But I enable collisions, and tell him he’s supposed to turn around after reaching the coffee maker.

Steve is successfully making his copies, but Dan has apparently decided he doesn’t care about coffee. In spite of the fact that I have set him to toggle once he “collides” with the coffee maker… He is walking through walls and floating on air and just wandering aimlessly in one direction offscreen. Dan has left the building, and he ain’t coming back.

Long story short. How to reprogram Dan to turn around after reaching the coffee maker, without bouncing off of Steve?

I know this is elementary level stuff, and there has to be a really simple solution for it, but I am apparently not smart enough to figure it out for myself.

There’s an example here for an enemy that goes from one wall to the other like that I believe

Thanks! But I’ve already figured out a way to make solid sprites move from one wall to another. What I’m trying to do is create two different sprites, one solid and one not, so that they don’t bounce off of each other, and so that they each remain in different zones.

Essentially I have already created a solid sprite, we’ll call it x. It’s only supposed to wander back and forth between barriers A and B. I’m trying to create a second sprite, we’ll call it y. Sprite y is supposed to wander back and forth between barriers A and C, without interacting with either barrier B or sprite x.

A____x____B_____y_____C

Which is why I made sprite y non solid, so that it would pass through both barrier B and sprite x. I’m trying to get it to switch directions when colliding with barriers A and C only. But as a non solid sprite, it’s ignoring collision commands altogether, even though I enabled collisions for it and have tried to specifically tell it to switch directions when colliding with barriers A and C. It is acting like A and C don’t even exist.

Making it a solid sprite, as the video explains, does make it switch directions when colliding with A and C. But it also makes it collide with B and x. I want it to ignore B and x and pass through them as if they don’t even exist (but NOT ignore A and C… it seems like it just wants to either collide with everything, or nothing).

Never mind, I solved it myself. Stupid me, I suddenly remembered I had already created a sprite in the first level that behaved exactly how I wanted the new one to behave. Erm… you can go ahead and close this thread now. :blush: