Implemented start line in RaceController

- Added coordinates as given in Story 10
- Displayed start line
- Marked line ends with circles
#story [10]
main
cbt24 9 years ago
parent 6ca26d5bb1
commit 6c3b7ccee7

@ -6,6 +6,7 @@ import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.TableView;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Line;
import seng302.Coordinate;
import seng302.RaceMap;
@ -35,8 +36,12 @@ public class RaceController extends Controller{
this.gc = raceMap.getGraphicsContext2D();
this.map = new RaceMap(32.321989, -64.866142, 32.273089, -64.814987, (int)raceMap.getWidth(), (int)raceMap.getHeight());
Coordinate boat1coord = this.map.convertGPS(32.296577, -64.854304);
System.out.println(boat1coord.getX() + " " + boat1coord.getY());
displayBoat(boat1coord, Color.AQUAMARINE);
gc.setStroke(Color.GREEN);
gc.setFill(Color.GREEN);
Coordinate startline1 = this.map.convertGPS(32.296577, -64.854304);
Coordinate startline2 = this.map.convertGPS(32.293771, -64.855242);
gc.strokeLine(startline1.getX(), startline1.getY(), startline2.getX(), startline2.getY());
gc.fillOval(startline1.getX()-3, startline1.getY()-3, 6, 6);
gc.fillOval(startline2.getX()-3, startline2.getY()-3, 6, 6);
}
}

Loading…
Cancel
Save