moveLeft method
Move player to Left
Implementation
void moveLeft(double speed, {VoidCallback? onCollision}) {
double innerSpeed = speed * dtUpdate;
Vector2Rect displacement = position.translate((innerSpeed * -1), 0);
if (_isCollision(displacement.position)) {
onCollision?.call();
return;
}
isIdle = false;
position = displacement;
lastDirection = Direction.left;
lastDirectionHorizontal = Direction.left;
}