Fixed sails so they behave correctly

- Changed sail angle calculations back
- Luffing currently displays no sail as a temporary representation of sails in

#story[1098]
main
Jessica Syder 8 years ago
parent f6cdf66bfe
commit ace1252c1d

@ -328,31 +328,29 @@ public class ResizableRaceCanvas extends ResizableCanvas {
double sailRotateAngle; // required rotation for correct sail display
Image sailImage;
// remove when method is finished
sailRotateAngle = 0;
sailImage = null;
gc.save();
// right half of points of sail
if (boatBearing < 180) {
if (ThisBoat.getInstance().isSailsOut()) {
if (boatBearing < 180) { // right half of points of sail
sailImage = sailsRight;
sailRotateAngle = boatBearing; // math
sailRotateAngle = boatBearing * 0.5; // math
xPos -= 1; // right align to boat edge on canvas
// System.out.println("right side -- boat: " + boatBearing +
// "|| rotate: " + sailRotateAngle);
}
// left half of points of sail
else {
else { // left half of points of sail
sailImage = sailsLeft;
sailRotateAngle = -(360 - boatBearing); // math
sailRotateAngle = -(360 - boatBearing) * 0.5; // math
xPos -= 5; // left align to boat edge on canvas
// System.out.println("left side -- boat: " + boatBearing +
// "|| rotate: " + sailRotateAngle);
}
// Change the angle of the sail if the sail is out
if (ThisBoat.getInstance().isSailsOut()) {
if (boatBearing < 180) {
sailRotateAngle -= 90;
} else {
sailRotateAngle += 90;
}
else {
// TODO: display luffing sail
}
// rotate sails based on boats current heading

Loading…
Cancel
Save