This commit is contained in:
Luan Nico
2020-09-27 15:15:58 -04:00
parent a6023f4cfe
commit 3c48aa345d
3 changed files with 4 additions and 104 deletions

View File

@ -46,8 +46,8 @@ class MyGame extends Game with MouseMovementDetector {
_onTarget = _toRect().contains(target.toOffset());
if (!_onTarget) {
final dir = (target - position).normalize();
position += dir * (SPEED * dt);
final dir = (target - position).normalized();
position += (SPEED * dt) * dir;
}
}
}