I’m making a game which is a clone of Scramble. I’m using a tile map to hold the landscape graphics and using a camera to move across the landscape horizontally by adding +1 to the camera’s x position. This works fine so far - I get a nice horizontal scrolling effect.
When it comes to the UFO section (UFOs move in a figure 8 motion towards the player but in line with the landscape motion) )this is (several) sprites which move on a path by changing the x and y position using an array of Vector2 values.
The problem is that the UFO sprite is moving whereas the tile map isn’t and I find that the path of the UFO isn’t sync’d with the landscape (the landscape is static but appears to move via the camera position change), even with just moving the sprite 1 pixel left it’s appearing to move faster and isn't aligned to the landscape which is how it should be.
How can I make it appear that the UFO sprite and the tile map is moving at the same rate. In the old days you would physically scroll both the landscape and the sprites which would keep them in sync. If you moved your landscape left 1 pixel and your sprite left 1 pixel, they would be in sync. My landscape is technically static and the sprite is being moved left.
Any thoughts on how I can simulate the UFO sprite moving inline with the landscape (when I'm using a camera to make the landscape appear to move but it's actually static)?
Apologies for the rather awkward way of asking, any pointers or suggestions are really appreciated, I'm not looking for actual code just a pointer on what I should change.