I recently upgraded my code to use an OrthographicCamera. Prior to this, I had a working parallax effect. Generally, I achieved movement by actually shifting my sprites. I can no longer maintain this method due to other positional adjustments making it too intricate, so I opted to use the camera. Instead of shifting my sprites, I shift the camera.
This killed my implementation of the parallax. I’m trying to think of how to recreate it using the camera.
Here’s what I’m thinking:
Create an array of cameras.
Each physics update (before drawing), I update the camera array with each of my layers’ cams.
Iterate through array applying the current cam to the spritebatch and draw each layer.
Is this a viable approach?