use of main.game.bf.Coordinates.FACING_DIRECTION in project Eidolons by IDemiurge.
the class AttackAnim method getRotateAction.
protected RotateByAction getRotateAction(float angle, float duration) {
RotateByAction mainRotate = new RotateByAction();
// angle += targetAngleOffset;
FACING_DIRECTION facing = getFacing();
// add default offset
boolean offhand = getActive().isOffhand();
Boolean left = PositionMaster.isToTheLeftOr(getOriginCoordinates(), getDestinationCoordinates());
Boolean above = PositionMaster.isAboveOr(getOriginCoordinates(), getDestinationCoordinates());
Boolean add = null;
if (facing.isVertical()) {
add = above;
} else {
add = left;
}
FACING_SINGLE relativeFacing = FacingMaster.getSingleFacing(facing, getOriginCoordinates(), getDestinationCoordinates());
// increase angle?
int addAngle = 0;
switch(relativeFacing) {
case IN_FRONT:
break;
case BEHIND:
break;
case TO_THE_SIDE:
if (getActive().isOffhand()) {
if (left) {
break;
}
}
case NONE:
// TODO on the same cell?
break;
}
angle += addAngle;
// pixel collision for impact!
mainRotate.setDuration(duration);
mainRotate.setAmount(angle);
return mainRotate;
}
Aggregations