cameraFollow method

void cameraFollow(
  1. double x,
  2. double y, [
  3. double speed = 0.00075
])

Implementation

void cameraFollow(double x, double y, [double speed = 0.00075]) {
  final diffX = screenCenterWorldX - x;
  final diffY = screenCenterWorldY - y;
  cameraX -= (diffX * 75) * speed;
  cameraY -= (diffY * 75) * speed;
}