followPlayerBoundsPush

fun followPlayerBoundsPush(sprite: Sprite2D, bboxX: Float = 0.2f, bboxY: Float = 0.2f)

Updates the camera so that it only moves when the sprite approaches screen edges. Creates a "dead zone" in the center where camera doesn't move. Higher bbox values means the camera moves more often.

Parameters

sprite

The sprite to follow

bboxX

The proportion of the dead screen on the X plane. Default is 0.2.

bboxY

The proportion of the dead screen on the Y plane. Default is 0.2.