Implemented luffing sail without image (yet).
- Added sailsLuff image property - Displayed luffing sail in correct position and angle #story[1098]
This commit is contained in:
@@ -31,6 +31,8 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
private Image background;
|
||||
private Image sailsRight = new Image("/images/sailsRight.png");
|
||||
private Image sailsLeft = new Image("/images/sailsLeft.png");
|
||||
// TODO: change to luffing sail image
|
||||
private Image sailsLuff = new Image("/images/sailsRight.png");
|
||||
|
||||
// annotations
|
||||
private boolean annoName = true;
|
||||
@@ -357,12 +359,15 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
sailImage = sailsLeft;
|
||||
xPos -= 5; // left align sail to boat edge on canvas
|
||||
}
|
||||
sailRotateAngle += ((boatBearing + windDirection) * 0.5);
|
||||
}
|
||||
else {
|
||||
// TODO: display luffing sail
|
||||
xPos -= 3;
|
||||
sailImage = sailsLuff;
|
||||
sailImage = null; // TODO: remove line when luffing image added
|
||||
sailRotateAngle = boatBearing;
|
||||
}
|
||||
|
||||
sailRotateAngle += ((boatBearing + windDirection) * 0.5);
|
||||
// System.out.println("boat: " + boatBearing + " || rotate: " +
|
||||
// sailRotateAngle + " || wind angle: " + windDirection);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user