How do I fake parallax to limit background movement

  • This has probably already been answered but I couldn't find it.

    This is what I am trying to do.

    I have many building. if i'm on the left side of the building a sprite behind it shows the left side as i pass in front of it it shows nothing on either side but as i reach the right it shows the right of the back sprite.

    Here are some images to give an example:

    But i want many buildings. I tried parallax but it does not stop the image from moving in the background ( I know it was a long shot but... )

    Any suggestions to fake the parallax effect? it doesn't have to be smooth either. I was thinking something like on collision or when overlapping but i'm not sure.

    Thanks for your time.

  • I figured something out... not perfect at all... not even something i like ....

    I added 2 sprites one before and one after the front of the building. and make the background image slide back and forth on overlapping the sprites.

    ugly but works ... kinda...

    Still looking forward to others offering suggestions.

    Thanks.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • hmmm

    I'm not well versed in this space yet, but I can tell you what I would try.

    I'd make 3 sprites one for each side and the face of the building. For each of the sides I would put their origin point right along the edge that connects to the face. Then create an event that would scale the width of those 2 sprites according to difference in x position of building and player, either in every tick, or only when player moves along X.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)