moveUpRight method
Move player to Up and Right
Implementation
bool moveUpRight(double speedX, double speedY) {
bool successRight = moveRight(
speedX * REDUCTION_SPEED_DIAGONAL,
notifyOnMove: false,
);
bool successUp = moveUp(
speedY * REDUCTION_SPEED_DIAGONAL,
notifyOnMove: false,
);
if (successRight && successUp) {
lastDirection = Direction.upRight;
}
if (successRight | successUp) {
onMove(
speed,
lastDirection,
BonfireUtil.getAngleFromDirection(lastDirection),
);
return true;
} else {
onMove(
0,
Direction.upRight,
BonfireUtil.getAngleFromDirection(Direction.upRight),
);
return false;
}
}