moveDownRight method
Move player to Down and Right
Implementation
bool moveDownRight(double speedX, double speedY) {
bool successRight = moveRight(speedX, notifyOnMove: false);
bool successDown = moveDown(speedY, notifyOnMove: false);
if (successRight && successDown) {
lastDirection = Direction.downRight;
}
if (successRight | successDown) {
onMove(speed, lastDirection, getAngleByDirectional(lastDirection));
return true;
} else {
onMove(
0, Direction.downRight, getAngleByDirectional(Direction.downRight));
return false;
}
}