Parallax Backgrounds

Yes, I know this question has been asked tons of times, and I've tried finding the answer for this question several times, but with no luck. I'm trying to make a parallax background for a platformer, but I want it to be able to move dynamically and follow the camera, but just move more slowly. The tutorials I've seen just say to give the background a move behavior that's slower than the foreground. But that's a strict, on-directional movement, I want something that will move with the player. Does anyone know how to do that? I know it's definitely possible as I've seen a few platformers (Cheeseman especially) that uses that effect.
Thank you!

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

Comments

  • ADSentertainmentADSentertainment Member Posts: 397

    Seriously, does no one know? Or are people assuming that I'm just not bothering to go and look it up in which I have multiple times?

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

  • SocksSocks London, UK.Member Posts: 12,822

    Movement in the opposite direction to the direction of movement.

    That will do it, as palindromic as it sounds.

  • RohalRohal GermanyMember Posts: 62

    ... don't forget the "Wrap X" for the scene!

  • mataruamatarua Auckland, New ZealandMember Posts: 854
    edited June 2014

    If you have no joy here I have done one and can share it. But it looks like @Fajlijp has got a template for ya.

    My particular one works by constraining the background to the player by a value that is multiplied by a smaller value.

    Say for example you have player1 x and y

    Constrain your backgroundImage to that players x and y but multiply it by a number which you can tune for horizontal or vertical.

    More likely to do something like player1x*0.5 and player1y*0.9

    That is how I do it.

  • ADSentertainmentADSentertainment Member Posts: 397

    @matarua said:
    If you have no joy here I have done one and can share it. But it looks like Fajlijp has got a template for ya.

    My particular one works by constraining the background to the player by a value that is multiplied by a smaller value.

    Say for example you have player1 x and y

    Constrain your backgroundImage to that players x and y but multiply it by a number which you can tune for horizontal or vertical.

    More likely to do something like player1x*0.5 and player1y*0.9

    That is how I do it.

    Actually, I did some more research and found a solution, that was actually what it was. But thank you!

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

  • mataruamatarua Auckland, New ZealandMember Posts: 854

    Cool I am glad you got it sorted - works a treat :})

Sign In or Register to comment.