* @param diff
* Wert, aus dem die neue Position errechnet wird
*/
public static void paintRedArrow(int diff, SpoutPlayer player) {
GenericTexture arrowTop = ConflictPlugin.arrowTopRed.get(player);
GenericTexture arrowBot = ConflictPlugin.arrowBotRed.get(player);
GenericTexture arrowLeft = ConflictPlugin.arrowLeftRed.get(player);
GenericTexture arrowRight = ConflictPlugin.arrowRightRed.get(player);
if (showArrowRed.get(player) == false) {
arrowTop.setVisible(false);
arrowLeft.setVisible(false);
arrowRight.setVisible(false);
arrowBot.setVisible(false);
return;
}
if (diff == 1000) {
arrowTop.setVisible(false);
arrowLeft.setVisible(false);
arrowRight.setVisible(false);
arrowBot.setVisible(false);
return;
}
// top
if (0 <= diff && diff <= 45) {
arrowTop.setVisible(true);
arrowTop.setX(diff * player.getMainScreen().getWidth() / 90);
arrowLeft.setVisible(false);
arrowRight.setVisible(false);
arrowBot.setVisible(false);
} else if (315 <= diff) {
arrowTop.setVisible(true);
arrowTop.setX(-(360 - diff) * player.getMainScreen().getWidth() / 90);
arrowLeft.setVisible(false);
arrowRight.setVisible(false);
arrowBot.setVisible(false);
} else
// rechts
if (diff > 45 && diff <= 135) {
arrowTop.setVisible(false);
arrowLeft.setVisible(false);
arrowRight.setVisible(true);
arrowRight.setY((diff - 90) * player.getMainScreen().getHeight() / 90);
arrowBot.setVisible(false);
} else
// links
if (diff < 315 && diff >= 225) {
arrowTop.setVisible(false);
arrowLeft.setVisible(true);
arrowLeft.setY((270 - diff) * player.getMainScreen().getHeight() / 90);
arrowRight.setVisible(false);
arrowBot.setVisible(false);
// bot
} else {
arrowTop.setVisible(false);
arrowLeft.setVisible(false);
arrowRight.setVisible(false);
arrowBot.setVisible(true);
}
}