Parallax Backgrounds
ADSentertainment
Member Posts: 397
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
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.
Movement in the opposite direction to the direction of movement.
That will do it, as palindromic as it sounds.
... don't forget the "Wrap X" for the scene!
http://www.stormystudio.com/game_templates/Vert_Hor_Parallax.html
Free template
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.
Cool I am glad you got it sorted - works a treat :})