Stopping a Sprite

The problem with this is that you can’t move the sprites after they touch. I want the sprites to be like tilemap walls.

What you could do is if a sprite is touching the “wall” sprite, than move it away until it’s not touching in on game update

But then you wouldn’t know the direction in which it came from

Maybe. I know how to find the direction. I wish there was a better way to do what I want to do. :tired_face:

What is your intention? To move the sprite?

You could also set a wall where your sprite is, and if it moves, just set the location under to a wall

But then it would have to be ghost

I was thinking about that, but it would cause a lot of lag. This is because I am using multiple sprites as walls. I will try it.

So you are using sprites as a wall

I have an idea but i don’t know if it will work

What is the idea? I want to come up with the most efficient way to make walls on the sprite. The sprites in my real game are 16 by 32 and 16 by 48.

If your sprites bottom is greater than the wall sprites top, move it up.
If the sprites left is less than the wall sprites right, move it right. Etc.

The problem with that is that if the sprite is in front of the wall, it will also move back.

Can anyone please help? (thanks for efforts: @UnsignedArduino, @LCProCODER and @Dreadmask197)

You want to push the sprite?
Try this:

1 Like

Press menu to restart

Not quite what I am looking for.

I included the two statements at the bottom the overlap function.

I this what you are looking for?

He wants them to move again and wants to use the other sprite almost like a wall

That is a really cool implementation of pushing a sprite; great job.

1 Like

Well I guess if @GameGod is able to better explain what the game should do, then we might be able to help.