Make a follow camera, the view goes to its target at once
target EngineObject|Vector2 optionalWhat to follow, an object or a position
smoothing number optional, default 0.1Seconds it takes to close most of the gap, 0 snaps
const camera = new FollowCamera(player);
camera.lookAhead = vec2(3, 0); // see further the way the player runs
camera.boundsMin = vec2(); // keep the view over the level
camera.boundsMax = levelSize;
Highest corner of the area the view stays in, Infinity on an axis leaves
that side open
Lowest corner of the area the view stays in
Size of a box in the middle of the view the target moves in without the view moving
How much more it shows the way the target goes on each axis, 0 for none
Seconds the look takes to slide across when it turns
How far the target must go back the other way before the look turns, so a jiggle
does not flip it
Where the target sits from the middle of the view, the view moved by it
The cameraScale it eases to, undefined leaves cameraScale to the game
Seconds the zoom takes to close most of the gap to scale, 0 snaps
Seconds it takes to close most of the gap to the target, 0 snaps
What it follows; destroyed or undefined, the view holds
Make this the camera that drives the view, it starts from where the view is
Put it on the target at once, with no easing, for a level start or a teleport; the view goes there too when
this camera is the one driving it
Start from where the view is, called when it takes over from another camera
Move toward the target and set the view, called by the camera plugin after the objects update
A camera is moved only by its target, physics leaves it alone