Question: create a new Java class, Ant, that draws the path of an ant that is walking randomly around a JavaFX window. This should look a
create a new Java class, Ant, that draws the path of an ant that is walking randomly around a JavaFX window. This should look a little like a scribbling on a page. If the ant walks off the edge of the screen re-center the ant and continue the random walk. Use the basic template from the code from lecture X01.
In addition to that, you may find the following helpful: ...
primaryStage.setScene(scene);
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(100), ae -> { /* your code goes here */ }));
timeline.setCycleCount(Animation.INDEFINITE);
timeline.play(); primaryStage.show(); ...
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
