Implemented Finish Line to show

- shows a dark red line with 2 thickness
- shows two rectangles at the ends of each line
#story [11]
main
Fan-Wu Yang 9 years ago
parent 6ca26d5bb1
commit 5108c0eaf5

@ -30,13 +30,21 @@ public class RaceController extends Controller{
} }
@Override @Override
public void initialize(URL location, ResourceBundle resources) { public void initialize(URL location, ResourceBundle resources) {
this.gc = raceMap.getGraphicsContext2D(); this.gc = raceMap.getGraphicsContext2D();
this.map = new RaceMap(32.321989, -64.866142, 32.273089, -64.814987, (int)raceMap.getWidth(), (int)raceMap.getHeight()); 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); Coordinate boat1coord = this.map.convertGPS(32.296577, -64.854304);
System.out.println(boat1coord.getX() + " " + boat1coord.getY());
displayBoat(boat1coord, Color.AQUAMARINE); displayBoat(boat1coord, Color.AQUAMARINE);
gc.setStroke(Color.DARKRED);
gc.setLineWidth(2);
Coordinate finishLineCoord1 = this.map.convertGPS(32.317379, -64.839291);
Coordinate finishLineCoord2 = this.map.convertGPS(32.317257, -64.836260);
gc.strokeLine(finishLineCoord1.getX(), finishLineCoord1.getY(), finishLineCoord2.getX(), finishLineCoord2.getY());
gc.strokeRect(finishLineCoord1.getX() - 1, finishLineCoord1.getY() - 1, 3, 3);
gc.strokeRect(finishLineCoord2.getX() - 1, finishLineCoord2.getY() - 1, 3, 3);
} }
} }

Loading…
Cancel
Save