update method
Implementation
update({bool? y, bool? x}) {
if (y != null || x != null) {
_buildVelocity(y: y, x: x);
}
position += velocity;
if (position.dx < 0 || position.dx > maxWidth || position.dy < 0 || position.dy > maxHeight) {
reset();
}
}