lookAhead property

double lookAhead
final

How far ahead of the runner the camera aims, in seconds of travel.

The camera watched where the runner was. It followed a point on the body, so a player sprinting right saw the same amount of level ahead of them as behind — and a platformer is about what is coming. Aiming a fraction of a second up the road puts the landing on screen before the jump has to be committed to.

In seconds rather than metres, so it widens by itself as the runner speeds up: a walk needs almost none of this and a sprint needs all of it, and a fixed distance is wrong at one end or the other.

A third of a second is about two metres at a sprint. Zero is the old behaviour exactly.

Implementation

final double lookAhead;