I’ll likely think of an idea tomorrow (or start with one idea and come up with a better one some time during the weekend and have to rewrite a lot) but it’s worth a shot anyway…
Let’s take a simple example. A ball flies across the screen inside of a container (and can fly out of stage bounds to the left, right, top, or bottom). A TrackingCamera class follows that ball as it flies, adding some easing and zooming for effect.
The TrackingCamera class is also tied to the ball’s container, either directly or a third class updates the container’s properties whenever the camera updates. The TrackingCamera looks at the position of the ball, and updates the x or y position of the container based on that information.
The goal of the camera is (likely) to make sure the ball is always visible, perhaps making sure it is always in the middle of the screen, or something, depending on which rules are set up.
I’m just not really sure how to structure this class yet (what properties, functions, or features for the class to have etc). I want it to be reusable where I can tie the camera to any one container and any one (or several) “targets”. I can do the code part, I’m just trying to think of a good, easy to use “system” for it all.
Any ideas? Am I making it clear what I am looking for?